Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- data LinAst
- (.+.) :: LinAst -> LinAst -> LinAst
- class Coefficient x y where
- multLin :: LinAst -> LinAst
- data LinVar = LinVar {}
- hasName :: String -> LinVar -> Bool
- mapName :: (String -> String) -> LinVar -> LinVar
- hasCoeff :: Double -> LinVar -> Bool
- mapCoeff :: (Double -> Double) -> LinVar -> LinVar
- data LinExpr = LinExpr {}
- mergeLinExpr :: LinExpr -> LinExpr -> LinExpr
- addLin :: LinAst -> LinExpr
- removeDupLin :: LinExpr -> LinExpr
- makeLinExpr :: LinAst -> LinExpr
- data Ineq
- (.==.) :: LinAst -> LinAst -> Ineq
- (.<=.) :: LinAst -> LinAst -> Ineq
- (.=>.) :: LinAst -> LinAst -> Ineq
- data IneqStdForm
- getStdVars :: IneqStdForm -> [LinVar]
- mapStdVars :: ([LinVar] -> [LinVar]) -> IneqStdForm -> IneqStdForm
- getStdConst :: IneqStdForm -> Double
- mapStdConst :: (Double -> Double) -> IneqStdForm -> IneqStdForm
- standardForm :: Ineq -> IneqStdForm
- standardize :: Ineq -> Ineq
User-facing API
User-facing abstract syntax tree
class Coefficient x y where Source
multLin :: LinAst -> LinAst Source
Pushes ECoeff
down the tree, leaving EAdd
at the top level.
After using this funciton, all ECoeff
constructors LinAst
parameter will
be EVar
.
Linear Expressions
Linear expressions suited for normal and standard form.
mergeLinExpr :: LinExpr -> LinExpr -> LinExpr Source
removeDupLin :: LinExpr -> LinExpr Source
Merged duplicate LinVar
s in a LinExpr
. Should be used after addLin
.
makeLinExpr :: LinAst -> LinExpr Source
Linear Inequalities
Standard Form
data IneqStdForm Source
Eq IneqStdForm Source | |
Show IneqStdForm Source | |
Arbitrary IneqStdForm Source |
getStdVars :: IneqStdForm -> [LinVar] Source
mapStdVars :: ([LinVar] -> [LinVar]) -> IneqStdForm -> IneqStdForm Source
getStdConst :: IneqStdForm -> Double Source
mapStdConst :: (Double -> Double) -> IneqStdForm -> IneqStdForm Source
standardForm :: Ineq -> IneqStdForm Source
Turns a user-level AST to a structurally standard from inequality.
standardize :: Ineq -> Ineq Source
Standardizes user-level inequalities - to be used before standardForm
.