Safe Haskell | None |
---|---|
Language | Haskell98 |
A module defining the algebra of commutative polynomials over a field k.
Most users should probably use Math.CommutativeAlgebra.Polynomial instead, which is basically the same thing but more fully-featured. This module will probably be deprecated at some point, but remains for now because it has a simpler implementation which may be more helpful for people wanting to understand the code.
- data GlexMonomial v = Glex Int [(v, Int)]
- type GlexPoly k v = Vect k (GlexMonomial v)
- glexVar :: Num k => v -> GlexPoly k v
- class Monomial m where
- bind :: (Monomial m, Eq k, Num k, Ord b, Show b, Algebra k b) => Vect k (m v) -> (v -> Vect k b) -> Vect k b
- lt :: Vect t t1 -> (t1, t)
- class DivisionBasis b where
- dividesT :: DivisionBasis b => (b, t) -> (b, t1) -> Bool
- divT :: (DivisionBasis t, Fractional t1) => (t, t1) -> (t, t1) -> (t, t1)
- quotRemMP :: (DivisionBasis b, Algebra k b, Show b, Ord b, Fractional k, Eq k) => Vect k b -> [Vect k b] -> ([Vect k b], Vect k b)
- (%%) :: (Eq k, Fractional k, Ord b, Show b, Algebra k b, DivisionBasis b) => Vect k b -> [Vect k b] -> Vect k b
Documentation
data GlexMonomial v Source
Monomial GlexMonomial | |
(Eq k, Num k) => Coalgebra k (GlexMonomial v) | |
(Eq k, Num k, Ord v) => Algebra k (GlexMonomial v) | |
Eq v => Eq (GlexMonomial v) | |
Ord v => Ord (GlexMonomial v) | |
Show v => Show (GlexMonomial v) | |
Ord v => DivisionBasis (GlexMonomial v) |
type GlexPoly k v = Vect k (GlexMonomial v) Source
glexVar :: Num k => v -> GlexPoly k v Source
glexVar creates a variable in the algebra of commutative polynomials with Glex term ordering. For example, the following code creates variables called x, y and z:
[x,y,z] = map glexVar ["x","y","z"] :: GlexPoly Q String
bind :: (Monomial m, Eq k, Num k, Ord b, Show b, Algebra k b) => Vect k (m v) -> (v -> Vect k b) -> Vect k b Source
In effect, we have (Num k, Monomial m) => Monad (v -> Vect k (m v)), with return = var, and (>>=) = bind. However, we can't express this directly in Haskell, firstly because of the Ord b constraint, secondly because Haskell doesn't support type functions.
class DivisionBasis b where Source
Ord v => DivisionBasis (GlexMonomial v) |
dividesT :: DivisionBasis b => (b, t) -> (b, t1) -> Bool Source
divT :: (DivisionBasis t, Fractional t1) => (t, t1) -> (t, t1) -> (t, t1) Source