Safe Haskell | None |
---|---|
Language | Haskell2010 |
Canon representation of linear program
- data Program z r c = Program {
- _objective :: Linear z r c
- _constraints :: Constraint z r c
- _bounds :: Map (Either z r) (Maybe (R c), Maybe (R c))
- varsOfProgram :: (Ord z, Ord r) => Program z r c -> Set (Either z r)
- mergeBounds :: Rep c => (Maybe (R c), Maybe (R c)) -> (Maybe (R c), Maybe (R c)) -> (Maybe (R c), Maybe (R c))
- checkProgram :: (Rep c, Ord z, Ord r) => Assignment z r c -> Program z r c -> Bool
- checkBounds :: (Rep c, Ord z, Ord r) => Assignment z r c -> Map (Either z r) (Maybe (R c), Maybe (R c)) -> Bool
Documentation
A program represented by objective, constraints and bounds. There is no need for an optimisation direction; the objective is just negated.
Program | |
|
varsOfProgram :: (Ord z, Ord r) => Program z r c -> Set (Either z r) Source #
Find set of all variables mentioned in program
mergeBounds :: Rep c => (Maybe (R c), Maybe (R c)) -> (Maybe (R c), Maybe (R c)) -> (Maybe (R c), Maybe (R c)) Source #
Merge some lower and upper bounds
checkProgram :: (Rep c, Ord z, Ord r) => Assignment z r c -> Program z r c -> Bool Source #
Check whether an assignment satisfies the program's constraints and bounds