Copyright | (c) David Janin, 2016 |
---|---|
License | see the LICENSE file in the distribution |
Maintainer | janin@labri.fr |
Stability | experimental |
Safe Haskell | Safe |
Language | Haskell2010 |
An implementation of multi-variable linear polynoms. Associated partial order when variables are always assumed to have stricly positive values. This can also be seen as an algebra of (positive) delays with unknows.
Warning : the num and fractional instances are there for notational convinience. In order to stay within affine functions, the product fails over two non constant functions and teh inverse fails over a non constant function.
- data Affine d i = Affine !d ![(d, i)]
- affineFromID :: Num d => i -> Affine d i
- affineFromConst :: d -> Affine d i
- shiftAffine :: (Eq d, Num d, Ord i) => d -> Affine d i -> Affine d i
- setToZeroAffine :: (Num d, Ord i) => [i] -> Affine d i -> Affine d i
- evalAffine :: (Eq d, Num d, Ord i) => d -> Affine d i -> Affine d i
- getNextKnownDelay :: (Eq d, Num d) => Affine d i -> Maybe d
Documentation
Affine functions over a numeric space d and a set of variable index i.
Affine !d ![(d, i)] |
(Num d, Ord d, Ord i) => Eq (Affine d i) Source # | Semantical equality |
(Fractional d, Eq d, Ord i) => Fractional (Affine d i) Source # | For syntactic confort (with partially defined inverse) |
(Num d, Eq d, Ord i) => Num (Affine d i) Source # | For syntactic confort (with partially defined product) |
(Num d, Ord d, Ord i) => Ord (Affine d i) Source # | Total order with possible error |
(Show d, Show i) => Show (Affine d i) Source # | |
(Num d, Ord d, Ord i) => POrd (Affine d i) Source # | Semantical partial order (with positive variables) |
affineFromID :: Num d => i -> Affine d i Source #
Creates the one variable affine function (X_i) from index i.
affineFromConst :: d -> Affine d i Source #
Creates the constant affine function (d) from value d.
shiftAffine :: (Eq d, Num d, Ord i) => d -> Affine d i -> Affine d i Source #
Replaces any variable X by X + d
setToZeroAffine :: (Num d, Ord i) => [i] -> Affine d i -> Affine d i Source #
Sets variables Xi with i in the list to zero