limp-0.3.2.2: representation of Integer Linear Programs

Safe HaskellNone
LanguageHaskell2010

Numeric.Limp.Canon.Simplify.Bounder

Description

Convert linear constraints that only mention one variable to bounds

Synopsis

Documentation

type Bound z r c = (Either z r, (Maybe (R c), Maybe (R c))) Source #

bounderConstraint1 :: (Ord z, Ord r, Rep c) => Constraint1 z r c -> Either Infeasible (Maybe (Bound z r c)) Source #

Convert a single constraint into a bound, if possible.

bounder $ Constraint (5 <= y <= 10)
== Bound (Just 5) y (Just 10)
bounder $ Constraint (5 <= 2y <= 10)
== Bound (Just 2.5) y (Just 5)
bounder $ Constraint (10 <= 2y <= 5)
== Left InfeasibleBoundEmpty

bounderConstraint :: (Ord z, Ord r, Rep c) => Constraint z r c -> Either Infeasible (Constraint z r c, [Bound z r c]) Source #

bounderProgram :: (Ord z, Ord r, Rep c) => Program z r c -> Either Infeasible (Program z r c) Source #