ReducerPack<Q>::MultipleWithPos::MultipleWithPos( const Poly& poly, NewConstTerm multipleParam ): pos(poly.begin()), end(poly.end()), current(poly.ring().allocMonomial()) { multiple.mono = poly.ring().monoid().alloc().release(); poly.ring().monoid().copy(*multipleParam.mono, *multiple.mono); multiple.coef = multipleParam.coef; }
void ReducerHashPack<Q>::insert(ConstMonoRef multiple, const Poly& poly) { MATHICGB_ASSERT(&poly.ring() == &mRing); if (poly.isZero()) return; NewConstTerm termMultiple = {1, multiple.ptr()}; insertEntry(new (mPool.alloc()) MultipleWithPos(poly, termMultiple)); }
void ReducerHashPack<Q>::insertTail(NewConstTerm multiple, const Poly& poly) { MATHICGB_ASSERT(&poly.ring() == &mRing); if (poly.termCount() <= 1) return; auto entry = new (mPool.alloc()) MultipleWithPos(poly, multiple); ++entry->pos; insertEntry(entry); }
void ReducerPackDedup<Q>::insert(ConstMonoRef multiple, const Poly& poly) { if (poly.isZero()) return; mLeadTermKnown = false; NewConstTerm termMultiple = {1, multiple.ptr()}; auto entry = new (mPool.alloc()) MultipleWithPos(poly, termMultiple); entry->computeCurrent(poly.ring()); mQueue.push(entry); }
void ReducerPackDedup<Q>::insertTail(NewConstTerm multiple, const Poly& poly) { if (poly.termCount() <= 1) return; mLeadTermKnown = false; auto entry = new (mPool.alloc()) MultipleWithPos(poly, multiple); ++entry->pos; entry->computeCurrent(poly.ring()); mQueue.push(entry); }
TournamentReducer::MultipleWithPos::MultipleWithPos (const Poly& poly, const_term multiple): pos(poly.begin()), end(poly.end()), multiple(allocTerm(poly.ring(), multiple)), current(poly.ring().allocMonomial()) {}