| Copyright | (c) Junaid Rasheed 2020-2022 |
|---|---|
| License | BSD-3 |
| Maintainer | jrasheed178@gmail.com |
| Stability | experimental |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Linear.Simplex.Types
Description
Synopsis
- type VarConstMap = [(Integer, Rational)]
- data PolyConstraint
- data ObjectiveFunction
- type Tableau = [(Integer, (VarConstMap, Rational))]
- type DictionaryForm = [(Integer, VarConstMap)]
Documentation
type VarConstMap = [(Integer, Rational)] Source #
data PolyConstraint Source #
For specifying constraints in a system.
The LHS is a VarConstMap, and the RHS, is a Rational number.
LEQ [(1, 2), (2, 1)] 3.5 is equivalent to 2x1 + x2 <= 3.5.
Users must only provide positive integer variables.
Example: LEQ [(2, 3), (6, (-1), (2, 1))] 12.3 is equivalent to 3x2 + (-x6) + x2 <= 12.3.
Constructors
| LEQ VarConstMap Rational | |
| GEQ VarConstMap Rational | |
| EQ VarConstMap Rational |
Instances
| Show PolyConstraint Source # | |
Defined in Linear.Simplex.Types Methods showsPrec :: Int -> PolyConstraint -> ShowS # show :: PolyConstraint -> String # showList :: [PolyConstraint] -> ShowS # | |
| Eq PolyConstraint Source # | |
Defined in Linear.Simplex.Types Methods (==) :: PolyConstraint -> PolyConstraint -> Bool # (/=) :: PolyConstraint -> PolyConstraint -> Bool # | |
data ObjectiveFunction Source #
Create an objective function.
We can either Maximize or Minimize a VarConstMap.
Constructors
| Max VarConstMap | |
| Min VarConstMap |
Instances
| Show ObjectiveFunction Source # | |
Defined in Linear.Simplex.Types Methods showsPrec :: Int -> ObjectiveFunction -> ShowS # show :: ObjectiveFunction -> String # showList :: [ObjectiveFunction] -> ShowS # | |
| Eq ObjectiveFunction Source # | |
Defined in Linear.Simplex.Types Methods (==) :: ObjectiveFunction -> ObjectiveFunction -> Bool # (/=) :: ObjectiveFunction -> ObjectiveFunction -> Bool # | |
type Tableau = [(Integer, (VarConstMap, Rational))] Source #
A Tableau of equations.
Each pair in the list is a row.
The first item in the pair specifies which Integer variable is basic in the equation.
The second item in the pair is an equation.
The VarConstMap in the second equation is a list of variables with their coefficients.
The RHS of the equation is a Rational constant.
type DictionaryForm = [(Integer, VarConstMap)] Source #
Type representing equations.
Each pair in the list is one equation.
The first item of the pair is the basic variable, and is on the LHS of the equation with a coefficient of one.
The RHS is represented using a VarConstMap.
The integer variable -1 is used to represent a Rational on the RHS