Copyright | (c) Andrew Lelechenko 2014-2015 |
---|---|
License | GPL-3 |
Maintainer | andrew.lelechenko@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Math.ExpPairs
Description
Package implements an algorithm to minimize the maximum of a list of rational objective functions over the set of exponent pairs. See full description in A. V. Lelechenko, Linear programming over exponent pairs. Acta Univ. Sapientiae, Inform. 5, No. 2, 271-287 (2013). http://www.acta.sapientia.ro/acta-info/C5-2/info52-7.pdf
A set of useful applications can be found in Math.ExpPairs.Ivic, Math.ExpPairs.Kratzel and Math.ExpPairs.MenzerNowak.
- optimize :: [RationalForm Rational] -> [Constraint Rational] -> OptimizeResult
- data OptimizeResult
- optimalValue :: OptimizeResult -> RationalInf
- optimalPair :: OptimizeResult -> InitPair
- optimalPath :: OptimizeResult -> Path
- simulateOptimize :: Rational -> OptimizeResult
- simulateOptimize' :: RationalInf -> OptimizeResult
- data LinearForm t
- data RationalForm t = (LinearForm t) :/: (LinearForm t)
- data IneqType
- data Constraint t
- type InitPair = InitPair' Rational
- data Path
- data RatioInf t
- type RationalInf = RatioInf Integer
- pattern K :: forall a. (Num a, Eq a) => a -> LinearForm a
- pattern L :: forall a. (Num a, Eq a) => a -> LinearForm a
- pattern M :: forall a. (Num a, Eq a) => a -> LinearForm a
- (>.) :: Num t => LinearForm t -> LinearForm t -> Constraint t
- (>=.) :: Num t => LinearForm t -> LinearForm t -> Constraint t
- (<.) :: Num t => LinearForm t -> LinearForm t -> Constraint t
- (<=.) :: Num t => LinearForm t -> LinearForm t -> Constraint t
- scaleLF :: (Num t, Eq t) => t -> LinearForm t -> LinearForm t
Documentation
optimize :: [RationalForm Rational] -> [Constraint Rational] -> OptimizeResult #
This function takes a list of rational forms and a list of constraints and returns an exponent pair, which satisfies all constraints and minimizes the maximum of all rational forms.
optimalValue :: OptimizeResult -> RationalInf #
The minimal value of objective function.
optimalPair :: OptimizeResult -> InitPair #
The initial exponent pair, on which minimal value was achieved.
optimalPath :: OptimizeResult -> Path #
The sequence of processes, after which minimal value was achieved.
simulateOptimize :: Rational -> OptimizeResult #
Wrap Rational
into OptimizeResult
.
simulateOptimize' :: RationalInf -> OptimizeResult #
Wrap RationalInf
into OptimizeResult
.
data LinearForm t #
Define an affine linear form of three variables: a*k + b*l + c*m.
First argument of LinearForm
stands for a, second for b
and third for c. Linear forms form a monoid by addition.
Instances
Functor LinearForm # | |
Foldable LinearForm # | |
Eq t => Eq (LinearForm t) # | |
Num t => Num (LinearForm t) # | |
Show t => Show (LinearForm t) # | |
Generic (LinearForm t) # | |
Num t => Monoid (LinearForm t) # | |
NFData t => NFData (LinearForm t) # | |
(Num t, Eq t, Pretty t) => Pretty (LinearForm t) # | |
type Rep (LinearForm t) # | |
data RationalForm t #
Define a rational form of two variables, equal to the ratio of two LinearForm
.
Constructors
(LinearForm t) :/: (LinearForm t) infix 5 |
Instances
Functor RationalForm # | |
Foldable RationalForm # | |
Eq t => Eq (RationalForm t) # | |
Num t => Fractional (RationalForm t) # | |
Num t => Num (RationalForm t) # | |
Show t => Show (RationalForm t) # | |
Generic (RationalForm t) # | |
NFData t => NFData (RationalForm t) # | |
(Num t, Eq t, Pretty t) => Pretty (RationalForm t) # | |
type Rep (RationalForm t) # | |
Constants to specify the strictness of Constraint
.
data Constraint t #
A linear constraint of two variables.
Instances
Functor Constraint # | |
Foldable Constraint # | |
Eq t => Eq (Constraint t) # | |
Show t => Show (Constraint t) # | |
Generic (Constraint t) # | |
NFData t => NFData (Constraint t) # | |
(Num t, Eq t, Pretty t) => Pretty (Constraint t) # | |
type Rep (Constraint t) # | |
Holds a list of Process
and a matrix of projective
transformation, which they define.
Extends a rational type with positive and negative infinities.
type RationalInf = RatioInf Integer #
Arbitrary-precision rational numbers with positive and negative infinities.
pattern K :: forall a. (Num a, Eq a) => a -> LinearForm a #
For a given c
returns linear form c * k
pattern L :: forall a. (Num a, Eq a) => a -> LinearForm a #
For a given c
returns linear form c * l
pattern M :: forall a. (Num a, Eq a) => a -> LinearForm a #
For a given c
returns linear form c * m
(>.) :: Num t => LinearForm t -> LinearForm t -> Constraint t infix 5 #
Build a constraint, which states that the value of the first linear form is greater than the value of the second one.
(>=.) :: Num t => LinearForm t -> LinearForm t -> Constraint t infix 5 #
Build a constraint, which states that the value of the first linear form is greater or equal to the value of the second one.
(<.) :: Num t => LinearForm t -> LinearForm t -> Constraint t infix 5 #
Build a constraint, which states that the value of the first linear form is less than the value of the second one.
(<=.) :: Num t => LinearForm t -> LinearForm t -> Constraint t infix 5 #
Build a constraint, which states that the value of the first linear form is less or equal to the value of the second one.
scaleLF :: (Num t, Eq t) => t -> LinearForm t -> LinearForm t #
Multiply a linear form by a given coefficient.