glpk-hs-0.5: Comprehensive GLPK linear programming bindings

Data.LinearProgram.GLPK.Solver

Description

Interface between the Haskell representation of a linear programming problem, a value of type LP, and the GLPK solver. The options available to the solver correspond naturally with GLPK's available options, so to find the meaning of any particular option, consult the GLPK documentation.

The option of which solver to use -- the general LP solver, which solves a problem over the reals, or the MIP solver, which allows variables to be restricted to integers -- can be made by choosing the appropriate constructor for GLPOpts.

The marshalling from Haskell to C is specialized for Ints and Doubles, so using those types in your linear program is recommended.

Synopsis

# Solver options

data GLPOpts Source #

Options available for customizing GLPK operations. This also determines which kind of solving is performed -- relaxed LP, or MIP.

Constructors

 SimplexOpts FieldsmsgLev :: MsgLev tmLim :: !Int presolve :: Bool MipOpts FieldsmsgLev :: MsgLev tmLim :: !Int presolve :: Bool brTech :: BranchingTechnique btTech :: BacktrackTechnique ppTech :: Preprocessing fpHeur :: Bool cuts :: [Cuts] mipGap :: !Double

# Running the solver

glpSolveVars :: (Ord v, Real c) => GLPOpts -> LP v c -> IO (ReturnCode, Maybe (Double, Map v Double)) Source #

Solves the linear or mixed integer programming problem. Returns the value of the objective function, and the values of the variables.

data RowValue v c Source #

Constructors

 RowVal Fieldsrow :: !(Constraint v c) rowVal :: !Double

glpSolveAll :: (Ord v, Real c) => GLPOpts -> LP v c -> IO (ReturnCode, Maybe (Double, Map v Double, [RowValue v c])) Source #

Solves the linear or mixed integer programming problem. Returns the value of the objective function, the values of the variables, and the values of any labeled rows.

# GLPK enumerations

Instances

 Source # Methods Source # Methods Source # MethodsshowList :: [ReturnCode] -> ShowS #

data MsgLev Source #

Constructors

 MsgOff MsgErr MsgOn MsgAll

Instances

 Source # MethodstoEnum :: Int -> MsgLev #enumFrom :: MsgLev -> [MsgLev] #enumFromThen :: MsgLev -> MsgLev -> [MsgLev] #enumFromTo :: MsgLev -> MsgLev -> [MsgLev] #enumFromThenTo :: MsgLev -> MsgLev -> MsgLev -> [MsgLev] # Source # Methods(==) :: MsgLev -> MsgLev -> Bool #(/=) :: MsgLev -> MsgLev -> Bool # Source # Methods Source # MethodsshowsPrec :: Int -> MsgLev -> ShowS #showList :: [MsgLev] -> ShowS #

Constructors

 FirstFrac LastFrac MostFrac DrTom HybridP

Instances

 Source # Methods Source # Methods Source # Methods Source # MethodsshowList :: [BranchingTechnique] -> ShowS #

Constructors

Instances

 Source # Methods Source # Methods Source # Methods Source # MethodsshowList :: [BacktrackTechnique] -> ShowS #

Constructors

 NoPre RootPre AllPre

Instances

 Source # Methods Source # Methods Source # Methods Source # MethodsshowList :: [Preprocessing] -> ShowS #

data Cuts Source #

Constructors

 GMI MIR Cov Clq

Instances

 Source # Methodssucc :: Cuts -> Cuts #pred :: Cuts -> Cuts #toEnum :: Int -> Cuts #fromEnum :: Cuts -> Int #enumFrom :: Cuts -> [Cuts] #enumFromThen :: Cuts -> Cuts -> [Cuts] #enumFromTo :: Cuts -> Cuts -> [Cuts] #enumFromThenTo :: Cuts -> Cuts -> Cuts -> [Cuts] # Source # Methods(==) :: Cuts -> Cuts -> Bool #(/=) :: Cuts -> Cuts -> Bool # Source # Methods Source # MethodsshowsPrec :: Int -> Cuts -> ShowS #show :: Cuts -> String #showList :: [Cuts] -> ShowS #