[NumericPrelude] multivariate polynomials
lemming at henning-thielemann.de
Sun Jun 20 03:48:31 EDT 2010
On Sat, 19 Jun 2010, Lewis-Sandy, Darrell wrote:
> In my polynomial library I did not have a function fromCoeffs because all my polynomials were multivariate. Instead, I had a function fromTerms:
> fromTerms :: (Ring a, Ord symbol) => [(ring,Bag symbol)] -> Poly symbol ring
> where a term was represented as a coefficient/monomial pair, and Bag was
> my monoidial mononomial type.
That is you do not only want a sparse polynomial representation but also a
sparse representation of the monomial exponents using Bags, right?
Nonetheless this would be just an instance of MathObj.Algebra, where (Bag
symbol) with mempty=Bag.empty and mappend=Bag.union (occurrences of all
bag elements are added) is the Monoid of monomials.
More information about the Numeric-prelude