Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Affine x c = Affine c (LinComb x c)
- splitVar :: Ord x => Additive c => x -> Affine x c -> (c, Affine x c)
- solve :: (Ord scalar, Eq scalar, Field scalar, Ord x, DecidableZero scalar) => x -> Affine x scalar -> Either (Affine x scalar) (Bool, Affine x scalar)
- constant :: (AbelianAdditive c, DecidableZero c) => Ord x => c -> Affine x c
- isConstant :: Eq c => Ord x => DecidableZero c => Affine x c -> Either x c
- var :: Multiplicative c => Additive c => v -> Affine v c
- eval :: forall x c v. (Additive x, Scalable x x) => (c -> x) -> (v -> x) -> Affine v c -> x
- subst :: (Ord x, AbelianAdditive c, DecidableZero c, Multiplicative c) => (v -> Affine x c) -> Affine v c -> Affine x c
- mapVars :: Ord x => (v -> x) -> Affine v c -> Affine x c
- traverseVars :: Ord x => Applicative f => (v -> f x) -> Affine v c -> f (Affine x c)
Documentation
Instances
Multiplicative c => Scalable c (Affine x c) Source # | |
Functor (Affine x) Source # | |
(Show c, Show x) => Show (Affine x c) Source # | |
(Ord x, AbelianAdditive c, DecidableZero c) => AbelianAdditive (Affine x c) Source # | |
Defined in Algebra.Morphism.Affine | |
(Ord x, AbelianAdditive c, DecidableZero c) => Additive (Affine x c) Source # | |
(Ord x, AbelianAdditive c, Group c, DecidableZero c) => Group (Affine x c) Source # | |
(Eq c, Eq x) => Eq (Affine x c) Source # | |
(Ord c, Ord x) => Ord (Affine x c) Source # | |
solve :: (Ord scalar, Eq scalar, Field scalar, Ord x, DecidableZero scalar) => x -> Affine x scalar -> Either (Affine x scalar) (Bool, Affine x scalar) Source #
solve x f
solves the equation f == 0
for x.
Let f = k x + e. If k == 0, return Left e. Otherwise, x and return Right -e/k. (The value of x)
constant :: (AbelianAdditive c, DecidableZero c) => Ord x => c -> Affine x c Source #
Constant affine expression
isConstant :: Eq c => Ord x => DecidableZero c => Affine x c -> Either x c Source #
eval :: forall x c v. (Additive x, Scalable x x) => (c -> x) -> (v -> x) -> Affine v c -> x Source #
subst :: (Ord x, AbelianAdditive c, DecidableZero c, Multiplicative c) => (v -> Affine x c) -> Affine v c -> Affine x c Source #
traverseVars :: Ord x => Applicative f => (v -> f x) -> Affine v c -> f (Affine x c) Source #