Пример #1
0
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();
}
Пример #2
0
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);
}
Пример #3
0
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);
}
Пример #4
0
void ReducerPack<Q>::MultipleWithPos::computeCurrent(const PolyRing& ring) {
  ring.monoid().multiply(*multiple.mono, pos.mono(), *current);  
}