math-programming-0.3.0: A library for formulating and solving math programs.

Safe HaskellSafe
LanguageHaskell2010

Math.Programming.Dsl

Synopsis

Documentation

minimize :: LPMonad m => Expr m -> m (Objective m) Source #

Create an objective to be minimized.

maximize :: LPMonad m => Expr m -> m (Objective m) Source #

Create an objective to be maximized.

evalExpr :: LPMonad m => Expr m -> m (Numeric m) Source #

Get the value of a linear expression in the current solution.

free :: LPMonad m => m (Variable m) Source #

Create a new free variable.

nonNeg :: LPMonad m => m (Variable m) Source #

Create a new non-negative variable.

nonPos :: LPMonad m => m (Variable m) Source #

Create a new non-positive variable.

bounded :: LPMonad m => Numeric m -> Numeric m -> m (Variable m) Source #

Create a new variable bounded between two values.

within :: LPMonad m => m (Variable m) -> Bounds (Numeric m) -> m (Variable m) Source #

Constrain a variable to take on certain values.

This function is designed to be used as an infix operator, e.g.

addVariable `within` NonNegativeReals

integer :: IPMonad m => m (Variable m) Source #

Create an integer-valued variable.

binary :: IPMonad m => m (Variable m) Source #

Create a binary variable.

nonNegInteger :: IPMonad m => m (Variable m) Source #

Create an integer-value variable that takes on non-negative values.

nonPosInteger :: IPMonad m => m (Variable m) Source #

Create an integer-value variable that takes on non-positive values.

asKind :: IPMonad m => m (Variable m) -> Domain -> m (Variable m) Source #

Set the type of a variable.

This function is designed to be used as an infix operator, e.g.

addVariable `asKind` Binary

named :: (Monad m, Nameable m a) => m a -> String -> m a Source #

Name a variable, constraint, or objective.

This function is designed to be used as an infix operator, e.g.

free `named` X_1

nameOf :: (Monad m, Nameable m a) => a -> m String Source #

Retrieve the name of a variable, constraint, or objective.

(#+@) :: Num a => a -> b -> LinearExpression a b infixl 6 Source #

(#+.) :: Num a => a -> LinearExpression a b -> LinearExpression a b infixl 6 Source #

(@+#) :: Num a => b -> a -> LinearExpression a b infixl 6 Source #

(@+@) :: Num a => b -> b -> LinearExpression a b infixl 6 Source #

(@+.) :: Num a => b -> LinearExpression a b -> LinearExpression a b infixl 6 Source #

(.+#) :: Num a => LinearExpression a b -> a -> LinearExpression a b infixl 6 Source #

(.+@) :: Num a => LinearExpression a b -> b -> LinearExpression a b infixl 6 Source #

(#-@) :: Num a => a -> b -> LinearExpression a b infixl 6 Source #

(#-.) :: Num a => a -> LinearExpression a b -> LinearExpression a b infixl 6 Source #

(@-#) :: Num a => b -> a -> LinearExpression a b infixl 6 Source #

(@-@) :: Num a => b -> b -> LinearExpression a b infixl 6 Source #

(@-.) :: Num a => b -> LinearExpression a b -> LinearExpression a b infixl 6 Source #

(.-#) :: Num a => LinearExpression a b -> a -> LinearExpression a b infixl 6 Source #

(.-@) :: Num a => LinearExpression a b -> b -> LinearExpression a b infixl 6 Source #

(#*.) :: Num a => a -> LinearExpression a b -> LinearExpression a b infixl 7 Source #

(.*#) :: Num a => LinearExpression a b -> a -> LinearExpression a b infixl 7 Source #

(#*@) :: Num a => a -> b -> LinearExpression a b infixl 7 Source #

(@*#) :: Num a => b -> a -> LinearExpression a b infixl 7 Source #

(@/#) :: Fractional a => b -> a -> LinearExpression a b infixl 7 Source #

(./#) :: Fractional a => LinearExpression a b -> a -> LinearExpression a b infixl 7 Source #

simplify :: (Ord b, Num a) => LinearExpression a b -> LinearExpression a b Source #

Combine equivalent terms by summing their coefficients.

eval :: Num a => LinearExpression a a -> a Source #

Reduce an expression to its value.

var :: Num a => b -> LinearExpression a b Source #

Construct an expression representing a variable.

con :: Num a => a -> LinearExpression a b Source #

Construct an expression representing a constant.

exprSum :: Num a => [LinearExpression a b] -> LinearExpression a b Source #

Construct an expression by summing expressions.

varSum :: Num a => [b] -> LinearExpression a b Source #

Construct an expression by summing variables.

(#<=@) :: LPMonad m => Numeric m -> Variable m -> m (Constraint m) infix 4 Source #

(#<=.) :: LPMonad m => Numeric m -> Expr m -> m (Constraint m) infix 4 Source #

(@<=#) :: LPMonad m => Variable m -> Numeric m -> m (Constraint m) infix 4 Source #

(@<=@) :: LPMonad m => Variable m -> Variable m -> m (Constraint m) infix 4 Source #

(@<=.) :: LPMonad m => Variable m -> Expr m -> m (Constraint m) infix 4 Source #

(.<=#) :: LPMonad m => Expr m -> Numeric m -> m (Constraint m) infix 4 Source #

(.<=@) :: LPMonad m => Expr m -> Variable m -> m (Constraint m) infix 4 Source #

(.<=.) :: LPMonad m => Expr m -> Expr m -> m (Constraint m) infix 4 Source #

(#>=@) :: LPMonad m => Numeric m -> Variable m -> m (Constraint m) infix 4 Source #

(#>=.) :: LPMonad m => Numeric m -> Expr m -> m (Constraint m) infix 4 Source #

(@>=#) :: LPMonad m => Variable m -> Numeric m -> m (Constraint m) infix 4 Source #

(@>=@) :: LPMonad m => Variable m -> Variable m -> m (Constraint m) infix 4 Source #

(@>=.) :: LPMonad m => Variable m -> Expr m -> m (Constraint m) infix 4 Source #

(.>=#) :: LPMonad m => Expr m -> Numeric m -> m (Constraint m) infix 4 Source #

(.>=@) :: LPMonad m => Expr m -> Variable m -> m (Constraint m) infix 4 Source #

(.>=.) :: LPMonad m => Expr m -> Expr m -> m (Constraint m) infix 4 Source #

(#==@) :: LPMonad m => Numeric m -> Variable m -> m (Constraint m) infix 4 Source #

(#==.) :: LPMonad m => Numeric m -> Expr m -> m (Constraint m) infix 4 Source #

(@==#) :: LPMonad m => Variable m -> Numeric m -> m (Constraint m) infix 4 Source #

(@==@) :: LPMonad m => Variable m -> Variable m -> m (Constraint m) infix 4 Source #

(@==.) :: LPMonad m => Variable m -> Expr m -> m (Constraint m) infix 4 Source #

(.==#) :: LPMonad m => Expr m -> Numeric m -> m (Constraint m) infix 4 Source #

(.==@) :: LPMonad m => Expr m -> Variable m -> m (Constraint m) infix 4 Source #

(.==.) :: LPMonad m => Expr m -> Expr m -> m (Constraint m) infix 4 Source #