limp-0.3.1.0: 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 -> 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)

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

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