Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Linear expressions of variables.
Synopsis
- data LinExpr a b = LinExpr ![(a, b)] !a
- (*.) :: Num a => a -> b -> LinExpr a b
- (.*) :: Num a => b -> a -> LinExpr a b
- (./) :: Fractional a => b -> a -> LinExpr a b
- scale :: Num a => a -> LinExpr a b -> LinExpr a b
- (.+.) :: Num a => LinExpr a b -> LinExpr a b -> LinExpr a b
- (.-.) :: Num a => LinExpr a b -> LinExpr a b -> LinExpr a b
- var :: Num a => b -> LinExpr a b
- con :: a -> LinExpr a b
- vsum :: Num a => [b] -> LinExpr a b
- esum :: Num a => Foldable t => t (LinExpr a b) -> LinExpr a b
- eval :: Num a => LinExpr a a -> a
- simplify :: (Num a, Ord b) => LinExpr a b -> LinExpr a b
Documentation
A linear expression.
Linear expressions contain symbolic variables of type b
and
numeric coefficients of type a
. Often a
will be Double
, and
b
will be whatever variable type your linear program uses.
LinExpr ![(a, b)] !a |
Instances
Foldable (LinExpr a) Source # | |
Defined in Math.Programming.LinExpr fold :: Monoid m => LinExpr a m -> m # foldMap :: Monoid m => (a0 -> m) -> LinExpr a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> LinExpr a a0 -> m # foldr :: (a0 -> b -> b) -> b -> LinExpr a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> LinExpr a a0 -> b # foldl :: (b -> a0 -> b) -> b -> LinExpr a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> LinExpr a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> LinExpr a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> LinExpr a a0 -> a0 # toList :: LinExpr a a0 -> [a0] # null :: LinExpr a a0 -> Bool # length :: LinExpr a a0 -> Int # elem :: Eq a0 => a0 -> LinExpr a a0 -> Bool # maximum :: Ord a0 => LinExpr a a0 -> a0 # minimum :: Ord a0 => LinExpr a a0 -> a0 # | |
Traversable (LinExpr a) Source # | |
Defined in Math.Programming.LinExpr | |
Functor (LinExpr a) Source # | |
Num a => Monoid (LinExpr a b) Source # | |
Num a => Semigroup (LinExpr a b) Source # | |
(Read a, Read b) => Read (LinExpr a b) Source # | |
(Show a, Show b) => Show (LinExpr a b) Source # | |
(Eq a, Eq b) => Eq (LinExpr a b) Source # | |
(*.) :: Num a => a -> b -> LinExpr a b infixl 7 Source #
Construct a term in a linear expression by multiplying a constant by a variable.
(.*) :: Num a => b -> a -> LinExpr a b infixl 7 Source #
Construct a term in a linear expression by multiplying a variable by a constant.
(./) :: Fractional a => b -> a -> LinExpr a b infixl 7 Source #
Construct a term in a linear expression by dividing a variable by a constant.
scale :: Num a => a -> LinExpr a b -> LinExpr a b Source #
Multiplication of linear expressions by a constant.
(.+.) :: Num a => LinExpr a b -> LinExpr a b -> LinExpr a b infixl 6 Source #
Addition of linear expressions.
(.-.) :: Num a => LinExpr a b -> LinExpr a b -> LinExpr a b infixl 6 Source #
The difference of linear expressions.