-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A GLPK backend to the math-programming library. -- -- Please see the README on GitHub at -- https://github.com/prsteele/math-programming-glpk#readme @package math-programming-glpk @version 0.4.0 -- | This module contains the full definitions backing the simplified API -- exposed in Glpk. module Math.Programming.Glpk.Internal -- | An environment to solve math programs using GLPK. newtype Glpk a Glpk :: ExceptT GlpkError (ReaderT GlpkEnv IO) a -> Glpk a [_runGlpk] :: Glpk a -> ExceptT GlpkError (ReaderT GlpkEnv IO) a runGlpk :: Glpk a -> IO (Either GlpkError a) data SolveType LP :: SolveType MIP :: SolveType InteriorPoint :: SolveType -- | An interface to the low-level GLPK API. -- -- High-level solver settings can be modified by altering the -- SimplexMethodControlParameters and MIPControlParameters -- values for LP and IP solves, respectively. data GlpkEnv GlpkEnv :: Ptr Problem -> IORef [GlpkVariable] -> IORef [GlpkConstraint] -> IORef SimplexMethodControlParameters -> IORef (MIPControlParameters Void) -> IORef (Maybe SolveType) -> GlpkEnv -- | A pointer to the Problem object. Most GLPK routines take this as the -- first argument. [_glpkEnvProblem] :: GlpkEnv -> Ptr Problem -- | The variables in the model [_glpkVariables] :: GlpkEnv -> IORef [GlpkVariable] -- | The constraints in the model [_glpkConstraints] :: GlpkEnv -> IORef [GlpkConstraint] -- | The control parameters for the simplex method [_glpkSimplexControl] :: GlpkEnv -> IORef SimplexMethodControlParameters -- | The control parameters for the MIP solver [_glpkMIPControl] :: GlpkEnv -> IORef (MIPControlParameters Void) -- | The type of the last solve. This is needed to know whether to retrieve -- simplex, interior point, or MIP solutions. [_glpkLastSolveType] :: GlpkEnv -> IORef (Maybe SolveType) data NamedRef a NamedRef :: Int -> IORef a -> NamedRef a [namedRefId] :: NamedRef a -> Int [namedRefRef] :: NamedRef a -> IORef a type GlpkConstraint = NamedRef Row type GlpkVariable = NamedRef Column askProblem :: Glpk (Ptr Problem) askVariablesRef :: Glpk (IORef [GlpkVariable]) askConstraintsRef :: Glpk (IORef [GlpkConstraint]) register :: Glpk (IORef [NamedRef a]) -> NamedRef a -> Glpk () unregister :: Enum a => Glpk (IORef [NamedRef a]) -> NamedRef a -> Glpk () data GlpkError UnknownVariable :: GlpkVariable -> GlpkError UnknownCode :: String -> CInt -> GlpkError readColumn :: Variable Glpk -> Glpk Column readRow :: Constraint Glpk -> Glpk Row addVariable' :: Glpk (Variable Glpk) setVariableName' :: Variable Glpk -> String -> Glpk () getVariableName' :: Variable Glpk -> Glpk String removeVariable' :: Variable Glpk -> Glpk () addConstraint' :: Inequality (LinearExpression Double (Variable Glpk)) -> Glpk (Constraint Glpk) setConstraintName' :: Constraint Glpk -> String -> Glpk () getConstraintName' :: Constraint Glpk -> Glpk String getDualValue' :: Constraint Glpk -> Glpk Double removeConstraint' :: Constraint Glpk -> Glpk () addObjective' :: LinearExpression Double (Variable Glpk) -> Glpk (Objective Glpk) getObjectiveName' :: Objective Glpk -> Glpk String setObjectiveName' :: Objective Glpk -> String -> Glpk () getObjectiveSense' :: Objective Glpk -> Glpk Sense setObjectiveSense' :: Objective Glpk -> Sense -> Glpk () getObjectiveValue' :: Objective Glpk -> Glpk Double optimizeLP' :: Glpk SolutionStatus optimizeIP' :: Glpk SolutionStatus setVariableBounds' :: Variable Glpk -> Bounds Double -> Glpk () getVariableBounds' :: Variable Glpk -> Glpk (Bounds Double) setVariableDomain' :: Variable Glpk -> Domain -> Glpk () getVariableDomain' :: Variable Glpk -> Glpk Domain getVariableValue' :: Variable Glpk -> Glpk Double getTimeout' :: RealFrac a => Glpk a setTimeout' :: RealFrac a => a -> Glpk () setRelativeMIPGap' :: RealFrac a => a -> Glpk () getRelativeMIPGap' :: RealFrac a => Glpk a solutionStatus :: GlpkSolutionStatus -> SolutionStatus -- | Write out the current formulation to a file. writeFormulation :: FilePath -> Glpk () maxCDouble :: CDouble instance Control.Monad.Error.Class.MonadError Math.Programming.Glpk.Internal.GlpkError Math.Programming.Glpk.Internal.Glpk instance Control.Monad.Reader.Class.MonadReader Math.Programming.Glpk.Internal.GlpkEnv Math.Programming.Glpk.Internal.Glpk instance Control.Monad.IO.Class.MonadIO Math.Programming.Glpk.Internal.Glpk instance GHC.Base.Monad Math.Programming.Glpk.Internal.Glpk instance GHC.Base.Applicative Math.Programming.Glpk.Internal.Glpk instance GHC.Base.Functor Math.Programming.Glpk.Internal.Glpk instance GHC.Show.Show Math.Programming.Glpk.Internal.GlpkError instance GHC.Show.Show (Math.Programming.Types.Constraint Math.Programming.Glpk.Internal.Glpk) instance GHC.Classes.Ord (Math.Programming.Types.Constraint Math.Programming.Glpk.Internal.Glpk) instance GHC.Classes.Eq (Math.Programming.Types.Constraint Math.Programming.Glpk.Internal.Glpk) instance GHC.Show.Show (Math.Programming.Types.Variable Math.Programming.Glpk.Internal.Glpk) instance GHC.Classes.Ord (Math.Programming.Types.Variable Math.Programming.Glpk.Internal.Glpk) instance GHC.Classes.Eq (Math.Programming.Types.Variable Math.Programming.Glpk.Internal.Glpk) instance Math.Programming.Types.LPMonad Math.Programming.Glpk.Internal.Glpk instance Math.Programming.Types.IPMonad Math.Programming.Glpk.Internal.Glpk instance GHC.Classes.Eq (Math.Programming.Glpk.Internal.NamedRef a) instance GHC.Classes.Ord (Math.Programming.Glpk.Internal.NamedRef a) instance GHC.Show.Show (Math.Programming.Glpk.Internal.NamedRef a) -- | A GLPK backend to the Programming library. -- -- This package allows both linear and mixed-integer programs to be -- solved. module Math.Programming.Glpk -- | An environment to solve math programs using GLPK. data Glpk a runGlpk :: Glpk a -> IO (Either GlpkError a) -- | Write out the current formulation to a file. writeFormulation :: FilePath -> Glpk () -- | An interface to the low-level GLPK API. -- -- High-level solver settings can be modified by altering the -- SimplexMethodControlParameters and MIPControlParameters -- values for LP and IP solves, respectively. data GlpkEnv data GlpkError