Copyright | (c) Masahiro Sakai 2011-2019 |
---|---|
License | BSD-style |
Maintainer | masahiro.sakai@gmail.com |
Stability | provisional |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Extensions | Cpp |
Mixed-Integer Programming Problems with some commmonly used extensions
Synopsis
- data Problem c = Problem {
- name :: Maybe Text
- objectiveFunction :: ObjectiveFunction c
- constraints :: [Constraint c]
- sosConstraints :: [SOSConstraint c]
- userCuts :: [Constraint c]
- varType :: Map Var VarType
- varBounds :: Map Var (Bounds c)
- type Label = Text
- type Var = InternedText
- toVar :: String -> Var
- fromVar :: Var -> String
- data VarType
- getVarType :: Problem c -> Var -> VarType
- type BoundExpr c = Extended c
- data Extended r
- type Bounds c = (BoundExpr c, BoundExpr c)
- defaultBounds :: Num c => Bounds c
- defaultLB :: Num c => BoundExpr c
- defaultUB :: BoundExpr c
- getBounds :: Num c => Problem c -> Var -> Bounds c
- variables :: Problem c -> Set Var
- integerVariables :: Problem c -> Set Var
- semiContinuousVariables :: Problem c -> Set Var
- semiIntegerVariables :: Problem c -> Set Var
- newtype Expr c = Expr [Term c]
- varExpr :: Num c => Var -> Expr c
- constExpr :: (Eq c, Num c) => c -> Expr c
- terms :: Expr c -> [Term c]
- data Term c = Term c [Var]
- data OptDir
- data ObjectiveFunction c = ObjectiveFunction {}
- data Constraint c = Constraint {
- constrLabel :: Maybe Label
- constrIndicator :: Maybe (Var, c)
- constrExpr :: Expr c
- constrLB :: BoundExpr c
- constrUB :: BoundExpr c
- constrIsLazy :: Bool
- (.==.) :: Num c => Expr c -> Expr c -> Constraint c
- (.<=.) :: Num c => Expr c -> Expr c -> Constraint c
- (.>=.) :: Num c => Expr c -> Expr c -> Constraint c
- data RelOp
- data SOSType
- data SOSConstraint c = SOSConstraint {}
- data Solution r = Solution {
- solStatus :: Status
- solObjectiveValue :: Maybe r
- solVariables :: Map Var r
- data Status
- meetStatus :: Status -> Status -> Status
- data FileOptions = FileOptions {}
- class Default a where
- def :: a
- class Variables a where
- intersectBounds :: Ord c => Bounds c -> Bounds c -> Bounds c
The MIP Problem type
Problem
Problem | |
|
Variables
type Var = InternedText Source #
variable
Variable types
Variable bounds
Extended r
is an extension of r with positive/negative infinity (±∞).
Instances
Functor Extended | |
Bounded (Extended r) | |
Eq r => Eq (Extended r) | |
(Fractional r, Ord r) => Fractional (Extended r) | Note that |
Data r => Data (Extended r) | |
Defined in Data.ExtendedReal gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Extended r -> c (Extended r) # gunfold :: (forall b r0. Data b => c (b -> r0) -> c r0) -> (forall r1. r1 -> c r1) -> Constr -> c (Extended r) # toConstr :: Extended r -> Constr # dataTypeOf :: Extended r -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Extended r)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Extended r)) # gmapT :: (forall b. Data b => b -> b) -> Extended r -> Extended r # gmapQl :: (r0 -> r' -> r0) -> r0 -> (forall d. Data d => d -> r') -> Extended r -> r0 # gmapQr :: forall r0 r'. (r' -> r0 -> r0) -> r0 -> (forall d. Data d => d -> r') -> Extended r -> r0 # gmapQ :: (forall d. Data d => d -> u) -> Extended r -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Extended r -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Extended r -> m (Extended r) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Extended r -> m (Extended r) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Extended r -> m (Extended r) # | |
(Num r, Ord r) => Num (Extended r) | Note that
|
Defined in Data.ExtendedReal | |
Ord r => Ord (Extended r) | |
Read r => Read (Extended r) | |
Show r => Show (Extended r) | |
NFData r => NFData (Extended r) | |
Defined in Data.ExtendedReal | |
Hashable r => Hashable (Extended r) | |
Defined in Data.ExtendedReal |
type Bounds c = (BoundExpr c, BoundExpr c) Source #
type for representing lower/upper bound of variables
defaultBounds :: Num c => Bounds c Source #
default bounds
Variable getters
Expressions
expressions
terms
Objective function
The OptDir
type represents optimization directions.
Instances
Bounded OptDir | |
Enum OptDir | |
Defined in Data.OptDir | |
Eq OptDir | |
Data OptDir | |
Defined in Data.OptDir gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OptDir -> c OptDir # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OptDir # toConstr :: OptDir -> Constr # dataTypeOf :: OptDir -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c OptDir) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OptDir) # gmapT :: (forall b. Data b => b -> b) -> OptDir -> OptDir # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OptDir -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OptDir -> r # gmapQ :: (forall d. Data d => d -> u) -> OptDir -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> OptDir -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OptDir -> m OptDir # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OptDir -> m OptDir # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OptDir -> m OptDir # | |
Ord OptDir | |
Read OptDir | |
Show OptDir | |
Ix OptDir | |
Generic OptDir | |
Hashable OptDir | |
Defined in Data.OptDir | |
type Rep OptDir | |
data ObjectiveFunction c Source #
objective function
Instances
Constraints
Linear (or Quadratic or Polynomial) constraints
data Constraint c Source #
constraint
Constraint | |
|
Instances
relational operators
SOS constraints
types of SOS (special ordered sets) constraints
Instances
Enum SOSType Source # | |
Eq SOSType Source # | |
Ord SOSType Source # | |
Defined in Numeric.Optimization.MIP.Base | |
Read SOSType Source # | |
Show SOSType Source # | |
data SOSConstraint c Source #
SOS (special ordered sets) constraints
Instances
Solutions
Type for representing a solution of MIP problem.
Solution | |
|
Instances
Functor Solution Source # | |
Eq r => Eq (Solution r) Source # | |
Ord r => Ord (Solution r) Source # | |
Defined in Numeric.Optimization.MIP.Base | |
Show r => Show (Solution r) Source # | |
Default (Solution r) Source # | |
Defined in Numeric.Optimization.MIP.Base |
MIP status with the following partial order:
StatusUnknown | |
StatusFeasible | |
StatusOptimal | |
StatusInfeasibleOrUnbounded | |
StatusInfeasible | |
StatusUnbounded |
meetStatus :: Status -> Status -> Status Source #
meet (greatest lower bound) operator of the partial order of Status
type.
If the version of lattices
is <2, then MeetSemiLattice
instance can also be used.
File I/O options
data FileOptions Source #
Instances
Show FileOptions Source # | |
Defined in Numeric.Optimization.MIP.Base showsPrec :: Int -> FileOptions -> ShowS # show :: FileOptions -> String # showList :: [FileOptions] -> ShowS # | |
Default FileOptions Source # | |
Defined in Numeric.Optimization.MIP.Base def :: FileOptions # |
Utilities
A class for types with a default value.
Nothing
Instances
class Variables a where Source #
Instances
Variables a => Variables [a] Source # | |
Variables (SOSConstraint c) Source # | |
Defined in Numeric.Optimization.MIP.Base | |
Variables (Constraint c) Source # | |
Defined in Numeric.Optimization.MIP.Base | |
Variables (ObjectiveFunction c) Source # | |
Defined in Numeric.Optimization.MIP.Base | |
Variables (Term c) Source # | |
Variables (Expr c) Source # | |
Variables (Problem c) Source # | |
(Variables a, Variables b) => Variables (Either a b) Source # | |