Skip to main content

Module sparse

Module sparse 

Source
Expand description

Sparse multivariate polynomial implementation.

A SparseMultivariatePolynomial stores only non-zero terms as a map from exponent vectors to coefficients. The exponent vector vec![e1, e2, ...] represents the monomial x1^e1 * x2^e2 * .... Monomial ordering is controlled by the MonomialOrder type parameter.

Structs§

BlockOrder
Block ordering: partition variables into contiguous blocks, each compared under its own sub-ordering.
Grevlex
Graded reverse lexicographic ordering: first by total degree descending, then reverse lexicographic (Cox–Little–O’Shea Def. 2.4: on equal degree, the monomial whose exponent difference has a negative rightmost nonzero entry is larger).
Grlex
Graded lexicographic ordering: first by total degree descending, then lexicographic.
Lex
Lexicographic ordering: compare exponents left-to-right.
MatrixOrder
Matrix ordering: compare monomials by multiplying exponent vectors by an integer matrix and comparing the results lexicographically.
SparseMultivariatePolynomial
A sparse multivariate polynomial with coefficients in a domain D and monomial ordering O.
WeightOrder
Weighted ordering: compare by $\sum_i w_i \cdot e_i$ descending.

Enums§

SubOrder
A sub-ordering used inside BlockOrder for each variable block.

Traits§

MonomialOrder
A monomial ordering determines how terms are sorted and compared.

Functions§

monomial_are_coprime
Return true if the two monomials are coprime (no variable appears in both).
monomial_divides
Check whether monomial a divides monomial b: a[i] >= b[i] for all i.
monomial_lcm
Compute the least common multiple of two monomials: element-wise max.