Frobby
0.9.5
|
A sparse univariate polynomial represented by a hash table mapping terms to coefficients. More...
#include <UniHashPolynomial.h>
Public Member Functions | |
void | add (bool plus, const mpz_class &exponent) |
Add +t^exponent or -t^exponent to the polynomial depending on whether plus is true or false, respectively. More... | |
void | add (int coef, size_t exponent) |
Add coef*t^exponent to the polynomial. More... | |
void | add (const mpz_class &coef, const mpz_class &exponent) |
Add coef*t^exponent to the polynomial. More... | |
void | feedTo (CoefBigTermConsumer &consumer, bool inCanonicalOrder=false) const |
size_t | getTermCount () const |
Private Types | |
typedef HashMap< mpz_class, mpz_class > | TermMap |
Private Attributes | |
TermMap | _terms |
A sparse univariate polynomial represented by a hash table mapping terms to coefficients.
This allows to avoid duplicate terms without a large overhead.
Definition at line 41 of file UniHashPolynomial.h.
|
private |
Definition at line 58 of file UniHashPolynomial.h.
void UniHashPolynomial::add | ( | bool | plus, |
const mpz_class & | exponent | ||
) |
Add +t^exponent or -t^exponent to the polynomial depending on whether plus is true or false, respectively.
Definition at line 25 of file UniHashPolynomial.cpp.
void UniHashPolynomial::add | ( | const mpz_class & | coef, |
const mpz_class & | exponent | ||
) |
Add coef*t^exponent to the polynomial.
Definition at line 44 of file UniHashPolynomial.cpp.
void UniHashPolynomial::add | ( | int | coef, |
size_t | exponent | ||
) |
Add coef*t^exponent to the polynomial.
Definition at line 35 of file UniHashPolynomial.cpp.
void UniHashPolynomial::feedTo | ( | CoefBigTermConsumer & | consumer, |
bool | inCanonicalOrder = false |
||
) | const |
Definition at line 64 of file UniHashPolynomial.cpp.
size_t UniHashPolynomial::getTermCount | ( | ) | const |
Definition at line 110 of file UniHashPolynomial.cpp.
|
private |
Definition at line 59 of file UniHashPolynomial.h.