26 mpz_class& ref =
_terms[exponent];
38 mpz_class& ref =
_terms[exponent];
47 mpz_class& ref =
_terms[exponent];
58 bool operator()(TermMap::const_iterator a, TermMap::const_iterator b) {
59 return a->first > b->first;
68 vector<mpz_class> term(1);
72 if (!inCanonicalOrder) {
74 TermMap::const_iterator termsEnd =
_terms.end();
75 TermMap::const_iterator it =
_terms.begin();
76 for (; it != termsEnd; ++it) {
79 consumer.
consume(it->second, term);
86 vector<TermMap::const_iterator> refs;
87 refs.reserve(
_terms.size());
89 TermMap::const_iterator termsEnd =
_terms.end();
90 for (TermMap::const_iterator it =
_terms.begin();
94 sort(refs.begin(), refs.end(), RefCompare());
97 vector<TermMap::const_iterator>::const_iterator refsEnd = refs.end();
98 vector<TermMap::const_iterator>::const_iterator refIt = refs.begin();
99 for (; refIt != refsEnd; ++refIt) {
100 TermMap::const_iterator it = *refIt;
103 consumer.
consume(it->second, term);
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
size_t getTermCount() const
void feedTo(CoefBigTermConsumer &consumer, bool inCanonicalOrder=false) const
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,...
Defines the variables of a polynomial ring and facilities IO involving them.
bool addVar(const string &name)
Adds the variable and returns true if name is not already a variable.