newtype Polynomial a
Finite-degree polynomials, with coefficients given by the type argument.
So for example, a
Polynomial Int is a polynomial with integer
Monoid instance works by considering polynomials as functions, where
<> corresponds to function composition and the identity polynomial
mempty is nothing more than the identity function
P(x) = x.
(Eq a) => Eq (Polynomial a)
(Eq a, Semiring a, Arbitrary a) => Arbitrary (Polynomial a)
(Eq a, Semiring a) => Semiring (Polynomial a)
(Eq a, Ring a) => Ring (Polynomial a)
(Eq a, CommutativeRing a) => CommutativeRing (Polynomial a)
(Eq a, Field a) => EuclideanRing (Polynomial a)
(Eq a, Semiring a) => Semigroup (Polynomial a)
(Eq a, Semiring a) => Monoid (Polynomial a)
(Show a, Semiring a, Eq a) => Show (Polynomial a)
projection :: Polynomial Number -> Polynomial Number -> Polynomial Number
Considering polynomials as vectors,
projection p q gives the orthogonal
p. If we let
r = projection p q, then
satisfies the following properties:
innerProduct (q - r) p == 0.0(approximately)
innerProduct p r == norm p * norm r, i.e.
rare linearly dependent.