Copyright | (c) Masahiro Sakai 2011 |
---|---|
License | BSD-style |
Maintainer | masahiro.sakai@gmail.com |
Stability | provisional |
Portability | non-portable (ScopedTypeVariables) |
Safe Haskell | None |
Language | Haskell2010 |
- type Solver r = (Var, Tableau r, VarSet, VarMap (Expr r))
- emptySolver :: VarSet -> Solver r
- type LP r = State (Solver r)
- getTableau :: LP r (Tableau r)
- putTableau :: Tableau r -> LP r ()
- newVar :: LP r Var
- addConstraint :: Real r => Atom r -> LP r ()
- addConstraintWithArtificialVariable :: Real r => Atom r -> LP r ()
- tableau :: RealFrac r => [Atom r] -> LP r ()
- define :: Var -> Expr r -> LP r ()
- phaseI :: (Fractional r, Real r) => LP r Bool
- simplex :: (Fractional r, Real r) => OptDir -> Expr r -> LP r Bool
- dualSimplex :: (Fractional r, Real r) => OptDir -> Expr r -> LP r Bool
- data OptResult
- twoPhaseSimplex :: (Fractional r, Real r) => OptDir -> Expr r -> LP r OptResult
- primalDualSimplex :: (Fractional r, Real r) => OptDir -> Expr r -> LP r OptResult
- getModel :: Fractional r => VarSet -> LP r (Model r)
- collectNonnegVars :: forall r. RealFrac r => [Atom r] -> VarSet -> (VarSet, [Atom r])
Solver type
emptySolver :: VarSet -> Solver r Source
LP monad
getTableau :: LP r (Tableau r) Source
putTableau :: Tableau r -> LP r () Source
Problem specification
addConstraint :: Real r => Atom r -> LP r () Source
Add a contraint, without maintaining feasibilty condition of tableaus.
- Disequality is not supported.
- Unlike
addConstraintWithArtificialVariable
, an equality constraint becomes two rows.
addConstraintWithArtificialVariable :: Real r => Atom r -> LP r () Source
Add a contraint and maintain feasibility condition by introducing artificial variable (if necessary).
- Disequality is not supported.
- Unlike
addConstraint
, an equality contstraint becomes one row with an artificial variable.
Solving
dualSimplex :: (Fractional r, Real r) => OptDir -> Expr r -> LP r Bool Source
results of optimization
twoPhaseSimplex :: (Fractional r, Real r) => OptDir -> Expr r -> LP r OptResult Source
primalDualSimplex :: (Fractional r, Real r) => OptDir -> Expr r -> LP r OptResult Source