Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- Describes a https://en.wikipedia.org/wiki/Monomial and operations on it.
- A monomial is merely a polynomial with a single non-zero term; cf. Binomial.
- type Monomial coefficient exponent = (coefficient, exponent)
- double :: Num c => Monomial c e -> Monomial c e
- mod' :: Integral c => Monomial c e -> c -> Monomial c e
- negateCoefficient :: Num c => Monomial c e -> Monomial c e
- realCoefficientToFrac :: (Real r, Fractional f) => Monomial r e -> Monomial f e
- shiftCoefficient :: Num c => Monomial c e -> c -> Monomial c e
- shiftExponent :: Num e => Monomial c e -> e -> Monomial c e
- square :: (Num c, Num e) => Monomial c e -> Monomial c e
- getExponent :: Monomial c e -> e
- getCoefficient :: Monomial c e -> c
- (<=>) :: Ord e => Monomial c e -> Monomial c e -> Ordering
- (</>) :: (Eq c, Fractional c, Num e) => Monomial c e -> Monomial c e -> Monomial c e
- (<*>) :: (Num c, Num e) => Monomial c e -> Monomial c e -> Monomial c e
- (=~) :: Eq e => Monomial c e -> Monomial c e -> Bool
- isMonomial :: Integral e => Monomial c e -> Bool
Types
Type-synonyms
type Monomial coefficient exponent = (coefficient, exponent) Source #
- The type of an arbitrary monomial.
- CAVEAT: though a monomial has an integral power, this contraint is only imposed at the function-level.
Functions
Reduce the coefficient using modular arithmetic.
realCoefficientToFrac :: (Real r, Fractional f) => Monomial r e -> Monomial f e Source #
Convert the type of the coefficient.
Shift the coefficient, by the specified amount.
Shift the exponent, by the specified amount.
Accessors
getExponent :: Monomial c e -> e Source #
Accessor.
getCoefficient :: Monomial c e -> c Source #
Accessor.
Operators
(<=>) :: Ord e => Monomial c e -> Monomial c e -> Ordering infix 4 Source #
Compares the exponents of the specified Monomial
s.
Divide the two specified Monomial
s.
(<*>) :: (Num c, Num e) => Monomial c e -> Monomial c e -> Monomial c e infixl 7 Source #
Multiply the two specified Monomial
s.
(=~) :: Eq e => Monomial c e -> Monomial c e -> Bool infix 4 Source #
True if the exponents are equal.