limp-0.3.2.3: representation of Integer Linear Programs

Safe HaskellNone
LanguageHaskell2010

Numeric.Limp.Canon.Simplify.Crunch

Description

Crunch together all constraints with same linear function

Synopsis

Documentation

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

Crunch the constraints in some program

crunchConstraint :: (Ord z, Ord r, Rep c) => Constraint z r c -> Constraint z r c Source #

Crunch some constraints. Constraints with the same function, for example

             2x + y    < 5
&&   0 <     2x + y
&&           2x + y    < 10

becomes

     0 <     2x + y    < 5

This should satisfy:

forall a c. check a c == check a (crunchConstraint c)
forall a.   length (checkConstraint c) <= length c