Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Index = Index Int
- fromIndex :: Index -> Int
- class (Eq c, Ord c, Num c, IsSigned c, Show c, Pretty c, Typeable c) => Ring c where
- type Field c = (Ring c, Fractional c)
- type Variable v = (Ord v, Show v, Pretty v, Typeable v)
- class Pretty m => Monomial m where
- type VarM m :: *
- normalizeM :: m -> m
- isNormalM :: m -> Bool
- fromListM :: [(VarM m, Int)] -> m
- toListM :: m -> [(VarM m, Int)]
- emptyM :: m
- isEmptyM :: m -> Bool
- variableM :: VarM m -> m
- singletonM :: VarM m -> Int -> m
- mulM :: m -> m -> m
- productM :: [m] -> m
- powM :: m -> Int -> m
- divM :: m -> m -> Maybe m
- diffM :: Num c => VarM m -> Int -> m -> Maybe (m, c)
- maxDegM :: m -> Int
- totalDegM :: m -> Int
- evalM :: Num c => (VarM m -> c) -> m -> c
- varSubsM :: (VarM m -> VarM m) -> m -> m
- termSubsM :: Num c => (VarM m -> Maybe c) -> (m, c) -> (m, c)
- proxyVarM :: Monomial m => m -> Proxy (VarM m)
- class (Pretty p, Ring (CoeffP p), FreeModule p, CoeffP p ~ CoeffF p, MonomP p ~ BaseF p) => AlmostPolynomial p where
- type CoeffP p :: *
- type MonomP p :: *
- type VarP p :: *
- fromListP :: [(MonomP p, CoeffP p)] -> p
- toListP :: p -> [(MonomP p, CoeffP p)]
- zeroP :: p
- isZeroP :: p -> Bool
- oneP :: p
- variableP :: VarP p -> p
- singletonP :: VarP p -> Int -> p
- monomP :: MonomP p -> p
- monomP' :: MonomP p -> CoeffP p -> p
- scalarP :: CoeffP p -> p
- addP :: p -> p -> p
- subP :: p -> p -> p
- negP :: p -> p
- sumP :: [p] -> p
- mulP :: p -> p -> p
- productP :: [p] -> p
- coeffOfP :: MonomP p -> p -> CoeffP p
- mulByMonomP :: MonomP p -> p -> p
- scaleP :: CoeffP p -> p -> p
- class (AlmostPolynomial p, Num p, Monomial (MonomP p), VarM (MonomP p) ~ VarP p) => Polynomial p where
- proxyCoeffP :: AlmostPolynomial p => p -> Proxy (CoeffP p)
- proxyMonomP :: AlmostPolynomial p => p -> Proxy (MonomP p)
- proxyVarP :: AlmostPolynomial p => p -> Proxy (VarP p)
Indices
The index of a variable. This will be used as the variable type
when the set of variables is a continguous set like {x_1, x_2, ... , x_N}
Rings
class (Eq c, Ord c, Num c, IsSigned c, Show c, Pretty c, Typeable c) => Ring c where Source #
The class of coefficient rings.
Since base rings like integers or rational behave differently than say another polynomial ring as a coefficient ring, we have to be explicit about some things (mainly for pretty-printing purposes
TODO: clean this up!
Nothing
Instances
Ring Int Source # | |
Ring Integer Source # | |
Ring Rational Source # | |
(Ring c, KnownSymbol v) => Ring (Poly c v) Source # | |
(Ring c, Variable v) => Ring (Poly c v) Source # | |
(Ring c, KnownSymbol v) => Ring (Univariate c v) Source # | |
Defined in Math.Algebra.Polynomial.Univariate isZeroR :: Univariate c v -> Bool Source # signumR :: Univariate c v -> Maybe Sign Source # absR :: Univariate c v -> Univariate c v Source # | |
(Ring c, KnownSymbol v, KnownNat n) => Ring (Poly c v n) Source # | |
(Ring c, KnownSymbol v, KnownNat n) => Ring (Poly c v n) Source # | |
(Ring c, KnownSymbol v, KnownNat n) => Ring (ExtAlg c v n) Source # | |
type Field c = (Ring c, Fractional c) Source #
The class of coefficient fields (this is just a constraint synonym for now)
type Variable v = (Ord v, Show v, Pretty v, Typeable v) Source #
The class of types whose inhabitants can serve as variables (this is just a constraint synonym for now)
Monomials
class Pretty m => Monomial m where Source #
The class of (multivariate) monomials
The Maybe
-s are there to allow truncated and exterior polynomial rings
:: m | |
-> m | enforce the invariant |
:: m | |
-> Bool | check the invariant construction and deconstruction |
:: m | the empty monomial (corresponding to the polynomial 1) |
:: m | |
-> Bool | checks whether it is empty |
:: VarM m | |
-> m | a single variable |
:: m | |
-> m | |
-> m | multiplication of monomials |
:: [m] | |
-> m | product of several monomials |
:: m | |
-> Int | |
-> m | raising to a power |
:: m | |
-> m | |
-> Maybe m | division of monomials calculus |
:: m | |
-> Int | maximum degree |
:: m | |
-> Int | total degree substitution and evaluation |
Instances
Polynomial rings
class (Pretty p, Ring (CoeffP p), FreeModule p, CoeffP p ~ CoeffF p, MonomP p ~ BaseF p) => AlmostPolynomial p where Source #
The class of almost polynomial rings
fromListP, toListP, zeroP, isZeroP, oneP, variableP, singletonP, monomP, monomP', scalarP, addP, subP, negP, mulP, coeffOfP, mulByMonomP, scaleP
Type of coefficients
Type of monomials
Type of variables
:: VarP p | |
-> p | a single variable |
monomP :: MonomP p -> p Source #
monomP' :: MonomP p -> CoeffP p -> p Source #
scalarP :: CoeffP p -> p Source #
coeffOfP :: MonomP p -> p -> CoeffP p Source #
mulByMonomP :: MonomP p -> p -> p Source #
Instances
class (AlmostPolynomial p, Num p, Monomial (MonomP p), VarM (MonomP p) ~ VarP p) => Polynomial p where Source #
The class of polynomial rings
evalP :: Num d => (CoeffP p -> d) -> (VarP p -> d) -> p -> d Source #
varSubsP :: (VarP p -> VarP p) -> p -> p Source #
coeffSubsP :: (VarP p -> Maybe (CoeffP p)) -> p -> p Source #
Instances
proxyCoeffP :: AlmostPolynomial p => p -> Proxy (CoeffP p) Source #
proxyMonomP :: AlmostPolynomial p => p -> Proxy (MonomP p) Source #