void TournamentReducer::value(Poly &result) { const_term t; while (leadTerm(t)) { result.appendTerm(t.coeff, t.monom); removeLeadTerm(); } resetReducer(); }
bool ReducerHashPack<Q>::leadTerm(NewConstTerm& result) { while (!mQueue.empty()) { auto entry = mQueue.top(); MATHICGB_ASSERT(entry != nullptr); if (!mRing.coefficientIsZero(entry->node->value())) { result.coef = entry->node->value(); result.mono = entry->node->mono().ptr(); return true; } removeLeadTerm(); } return false; }