comfort-glpk-0.0.1: Linear Programming using GLPK and comfort-array

Description

The monadic interface to GLPK allows to optimize with respect to multiple objectives, successively.

Synopsis

# Documentation

data T sh a Source #

Instances
 Monad (T sh) Source # Instance detailsDefined in Numeric.GLPK.Monad Methods(>>=) :: T sh a -> (a -> T sh b) -> T sh b #(>>) :: T sh a -> T sh b -> T sh b #return :: a -> T sh a #fail :: String -> T sh a # Functor (T sh) Source # Instance detailsDefined in Numeric.GLPK.Monad Methodsfmap :: (a -> b) -> T sh a -> T sh b #(<$) :: a -> T sh b -> T sh a # Applicative (T sh) Source # Instance detailsDefined in Numeric.GLPK.Monad Methodspure :: a -> T sh a #(<*>) :: T sh (a -> b) -> T sh a -> T sh b #liftA2 :: (a -> b -> c) -> T sh a -> T sh b -> T sh c #(*>) :: T sh a -> T sh b -> T sh b #(<*) :: T sh a -> T sh b -> T sh a # run :: (Indexed sh, Index sh ~ ix) => sh -> Bounds ix -> T sh a -> a Source # simplex :: (Eq sh, Indexed sh, Index sh ~ ix) => Constraints ix -> (Direction, Objective sh) -> T sh (Solution sh) Source # Add new constraints to an existing problem and solve with a new direction and objective. >>> case Shape.indexTupleFromShape tripletShape of (x,y,z) -> mapSnd (mapSnd Array.toTuple) <$> LP.run tripletShape [] (LP.simplex [[2.*x, 1.*y] <=. 10, [1.*y, (5::Double).*z] <=. 20] (LP.Maximize, Array.fromTuple (4,-3,2) :: Array.Array TripletShape Double))
Right (Optimal,(28.0,(5.0,0.0,4.0)))


exact :: (Eq sh, Indexed sh, Index sh ~ ix) => Constraints ix -> (Direction, Objective sh) -> T sh (Solution sh) Source #

data Direction Source #

Constructors

 Minimize Maximize
Instances
 Source # Instance detailsDefined in Numeric.GLPK.Private Methods Source # Instance detailsDefined in Numeric.GLPK.Private MethodsenumFrom :: Direction -> [Direction] # Source # Instance detailsDefined in Numeric.GLPK.Private Methods Source # Instance detailsDefined in Numeric.GLPK.Private MethodsshowList :: [Direction] -> ShowS #