gasp-1.4.0.0: A framework of algebraic classes
Safe HaskellSafe-Inferred
LanguageHaskell2010

Algebra.Morphism.Affine

Synopsis

Documentation

data Affine x c Source #

Constructors

Affine c (LinComb x c) 

Instances

Instances details
Multiplicative c => Scalable c (Affine x c) Source # 
Instance details

Defined in Algebra.Morphism.Affine

Methods

(*^) :: c -> Affine x c -> Affine x c Source #

Functor (Affine x) Source # 
Instance details

Defined in Algebra.Morphism.Affine

Methods

fmap :: (a -> b) -> Affine x a -> Affine x b #

(<$) :: a -> Affine x b -> Affine x a #

(Show c, Show x) => Show (Affine x c) Source # 
Instance details

Defined in Algebra.Morphism.Affine

Methods

showsPrec :: Int -> Affine x c -> ShowS #

show :: Affine x c -> String #

showList :: [Affine x c] -> ShowS #

(Ord x, AbelianAdditive c, DecidableZero c) => AbelianAdditive (Affine x c) Source # 
Instance details

Defined in Algebra.Morphism.Affine

(Ord x, AbelianAdditive c, DecidableZero c) => Additive (Affine x c) Source # 
Instance details

Defined in Algebra.Morphism.Affine

Methods

(+) :: Affine x c -> Affine x c -> Affine x c Source #

zero :: Affine x c Source #

times :: Natural -> Affine x c -> Affine x c Source #

(Ord x, AbelianAdditive c, Group c, DecidableZero c) => Group (Affine x c) Source # 
Instance details

Defined in Algebra.Morphism.Affine

Methods

(-) :: Affine x c -> Affine x c -> Affine x c Source #

subtract :: Affine x c -> Affine x c -> Affine x c Source #

negate :: Affine x c -> Affine x c Source #

mult :: Integer -> Affine x c -> Affine x c Source #

(Eq c, Eq x) => Eq (Affine x c) Source # 
Instance details

Defined in Algebra.Morphism.Affine

Methods

(==) :: Affine x c -> Affine x c -> Bool #

(/=) :: Affine x c -> Affine x c -> Bool #

(Ord c, Ord x) => Ord (Affine x c) Source # 
Instance details

Defined in Algebra.Morphism.Affine

Methods

compare :: Affine x c -> Affine x c -> Ordering #

(<) :: Affine x c -> Affine x c -> Bool #

(<=) :: Affine x c -> Affine x c -> Bool #

(>) :: Affine x c -> Affine x c -> Bool #

(>=) :: Affine x c -> Affine x c -> Bool #

max :: Affine x c -> Affine x c -> Affine x c #

min :: Affine x c -> Affine x c -> Affine x c #

splitVar :: Ord x => Additive c => x -> Affine x c -> (c, 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 #

var :: Multiplicative c => Additive c => v -> Affine v 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 #

mapVars :: Ord x => (v -> x) -> Affine v c -> Affine x c Source #

traverseVars :: Ord x => Applicative f => (v -> f x) -> Affine v c -> f (Affine x c) Source #