void ReducerPack<Q>::MultipleWithPos::destroy(const PolyRing& ring) { ring.monoid().freeRaw(*current); ring.monoid().freeRaw(*multiple.mono); // Call the destructor to destruct the iterators into std::vector. // In debug mode MSVC puts those in a linked list and the destructor // has to be called since it takes an iterator off the list. There were // memory corruption problems in debug mode before doing this on MSVC. this->~MultipleWithPos(); }
void ReducerPackDedup<Q>::MultipleWithPos::destroy(const PolyRing& ring) { MultipleWithPos* entry = this; do { ring.monoid().freeRaw(*entry->current); ring.monoid().freeRaw(*entry->multiple.mono); MultipleWithPos* next = entry->chain; MATHICGB_ASSERT(next != 0); // Call the destructor to destruct the iterators into std::vector. // In debug mode MSVC puts those in a linked list and the destructor // has to be called since it takes an iterator off the list. There were // memory corruption problems in debug mode on MSVC before doing this. entry->~MultipleWithPos(); entry = next; } while (entry != this); }
MATHICGB_NAMESPACE_BEGIN SigPolyBasis::SigPolyBasis( const PolyRing& R0, int monoLookupType, int monTableType, bool preferSparseReducers ): mMonoLookupFactory (MonoLookup::makeFactory(R0.monoid(), monoLookupType)), mRatioSorted(RatioOrder(mSigLeadRatio, R0.monoid())), mMinimalMonoLookup(mMonoLookupFactory->make(preferSparseReducers, true)), mBasis(R0, mMonoLookupFactory->make(preferSparseReducers, true)), mPreferSparseReducers(preferSparseReducers) { mTmp = mBasis.ring().allocMonomial(); const_cast<MonoLookup&>(mBasis.monoLookup()).setSigBasis(*this); mMinimalMonoLookup->setSigBasis(*this); }
void ReducerPack<Q>::MultipleWithPos::computeCurrent(const PolyRing& ring) { ring.monoid().multiply(*multiple.mono, pos.mono(), *current); }