Macaulay2 Engine
Loading...
Searching...
No Matches

◆ grow()

void MonomialHashTable< ValueType >::grow ( )
private

Definition at line 31 of file MonomialHashTable.cpp.

32 {
33 // Increase logsize, reset fields, and repopulate new hash table.
34 // if (M2_gbTrace >= 2) dump();
35
36 std::cout << "Growing hash table..." << std::flush;
37 dump();
38 mLog2Size++;
39 mThreshold *= 2;
40 mHashMask = (1 << mLog2Size) - 1;
41 std::vector<MonomialIndex> newBuckets(1<<mLog2Size, 0);
42 std::swap(mBuckets, newBuckets);
43
44 // Repopulates the mBuckets vector
45 for (size_t i = 1; i < mMonomialPointers.size(); ++i)
46 reInsert(i);
47
48 std::cout << "...Done" << std::endl;
49 }
void dump() const
stats and debugging information.
std::vector< MonomialView > mMonomialPointers
void reInsert(MonomialIndex i)
std::vector< MonomialIndex > mBuckets
void swap(mpfr::mpreal &x, mpfr::mpreal &y)
Definition mpreal.h:3244

References dump(), mBuckets, mHashMask, mLog2Size, mMonomialPointers, mThreshold, reInsert(), and std::swap().

Referenced by find().