Frobby
0.9.5
|
A sparse multivariate polynomial represented by a hash table mapping terms to coefficients. More...
#include <HashPolynomial.h>
Public Member Functions | |
HashPolynomial (size_t varCount=0) | |
void | clearAndSetVarCount (size_t varCount) |
void | add (const mpz_class &coef, const Term &term) |
Add coef*term to the polynomial. More... | |
void | add (bool plus, const Term &term) |
Add +term or -term to the polynomial depending on whether plus is true or false, respectively. More... | |
void | feedTo (const TermTranslator &translator, CoefBigTermConsumer &consumer, bool inCanonicalOrder) const |
size_t | getTermCount () const |
Private Types | |
typedef HashMap< Term, mpz_class > | TermMap |
Private Attributes | |
size_t | _varCount |
TermMap | _terms |
A sparse multivariate polynomial represented by a hash table mapping terms to coefficients.
This allows to avoid duplicate terms without a large overhead.
Definition at line 42 of file HashPolynomial.h.
|
private |
Definition at line 64 of file HashPolynomial.h.
HashPolynomial::HashPolynomial | ( | size_t | varCount = 0 | ) |
Definition at line 27 of file HashPolynomial.cpp.
void HashPolynomial::add | ( | bool | plus, |
const Term & | term | ||
) |
Add +term or -term to the polynomial depending on whether plus is true or false, respectively.
Definition at line 53 of file HashPolynomial.cpp.
void HashPolynomial::add | ( | const mpz_class & | coef, |
const Term & | term | ||
) |
Add coef*term to the polynomial.
Definition at line 36 of file HashPolynomial.cpp.
void HashPolynomial::clearAndSetVarCount | ( | size_t | varCount | ) |
Definition at line 31 of file HashPolynomial.cpp.
void HashPolynomial::feedTo | ( | const TermTranslator & | translator, |
CoefBigTermConsumer & | consumer, | ||
bool | inCanonicalOrder | ||
) | const |
Definition at line 76 of file HashPolynomial.cpp.
size_t HashPolynomial::getTermCount | ( | ) | const |
Definition at line 117 of file HashPolynomial.cpp.
|
private |
Definition at line 65 of file HashPolynomial.h.
|
private |
Definition at line 62 of file HashPolynomial.h.