47 mpz_class& ref =
_terms[term];
56 mpz_class& ref =
_terms[term];
70 bool operator()(TermMap::const_iterator a, TermMap::const_iterator b) {
79 bool inCanonicalOrder)
const {
84 if (!inCanonicalOrder) {
86 TermMap::const_iterator termsEnd =
_terms.end();
87 TermMap::const_iterator it =
_terms.begin();
88 for (; it != termsEnd; ++it)
89 consumer.
consume(it->second, it->first, translator);
95 vector<TermMap::const_iterator> refs;
96 refs.reserve(
_terms.size());
98 TermMap::const_iterator termsEnd =
_terms.end();
99 TermMap::const_iterator it =
_terms.begin();
100 for (; it != termsEnd; ++it)
104 sort(refs.begin(), refs.end(), RefCompare());
108 vector<TermMap::const_iterator>::const_iterator refsEnd = refs.end();
109 vector<TermMap::const_iterator>::const_iterator refIt = refs.begin();
110 for (; refIt != refsEnd; ++refIt)
111 consumer.
consume((*refIt)->second, (*refIt)->first, translator);
int lexCompare(const Exponent *a, const Exponent *b, size_t varCount)
Indicates how a relates to b according to the lexicographic term order where .
virtual void beginConsuming()=0
virtual void consume(const mpz_class &coef, const Term &term)
virtual void doneConsuming()=0
virtual void consumeRing(const VarNames &names)=0
void add(const mpz_class &coef, const Term &term)
Add coef*term to the polynomial.
size_t getTermCount() const
void clearAndSetVarCount(size_t varCount)
void feedTo(const TermTranslator &translator, CoefBigTermConsumer &consumer, bool inCanonicalOrder) const
HashPolynomial(size_t varCount=0)
TermTranslator handles translation between terms whose exponents are infinite precision integers and ...
const VarNames & getNames() const
Term represents a product of variables which does not include a coefficient.
size_t getVarCount() const