3#ifndef _monomial_sets_hpp_
4#define _monomial_sets_hpp_
62#include <unordered_set>
63#include <unordered_map>
176 if (*a != *b)
return false;
177 return std::equal(a, a + *a, b);
211 const int*
find(
const int* monom)
const
223 std::unordered_set<const int*, MonomialHashAndEqFixedSize, MonomialHashAndEqFixedSize>
mHash;
259 const int*
find(
const int* monom)
const
270 std::unordered_set<const int*, MonomialHashAndEqVarSize, MonomialHashAndEqVarSize>
mHash;
315 std::copy(monom, monom +
elementSize(), mon.first);
332 const int*
find(
const int* monom)
const
334 return mSet.find(monom);
383 std::copy(monom, monom + *monom, mon.first);
384 assert(mon.second - mon.first >= *monom);
400 const int*
find(
const int* monom)
const
402 return mSet.find(monom);
MonomialSetFixedSize mSet
const int * find(const int *monom) const
std::pair< const int *, bool > findOrInsert(const int *monom)
MonomialCollectionFixedSize(int monomialSize)
MonomialMemorySpace mMonomialMemory
MonomialMemorySpace & monomialMemorySpace()
std::pair< const int *, bool > findOrInsertTopInternedMonomial(int *&monom)
std::pair< const int *, bool > findOrInsert(const int *monom)
const int * find(const int *monom) const
MonomialMemorySpace & monomialMemorySpace()
MonomialCollectionVarSize()
MonomialMemorySpace mMonomialMemory
std::pair< const int *, bool > findOrInsertTopInternedMonomial(int *&monom)
std::size_t operator()(const int *m) const
MonomialHashAndEqFixedSize(int size)
Combined hash + equality functor for fixed-size monomials, plugged into the std::unordered_set inside...
std::size_t operator()(const int *m) const
MonomialHashAndEqVarSize()
Combined hash + equality functor for variable-size monomials, plugged into the std::unordered_set ins...
void freeAllAllocsAndBackingMemory()
std::pair< int *, int * > alloc(int size)
void shrinkLastAlloc(int *m)
void popLastAlloc(int *m)
Bump-pointer arena for monomial storage, backed by a memt::Arena.
std::size_t numElements() const
number of (unique) monomials in this set.
MonomialSetFixedSize(int monomialSize)
std::unordered_set< const int *, MonomialHashAndEqFixedSize, MonomialHashAndEqFixedSize > mHash
MonomialHashAndEqFixedSize mMonomialHashAndEq
const int * find(const int *monom) const
returns nullptr if monom is not present, otherwise returns the pointer equivalent to 'monom'.
int elementSize() const
size of each monomial
std::pair< const int *, bool > findOrInsert(const int *monom)
const int * find(const int *monom) const
returns nullptr if monom is not present, otherwise returns the pointer equivalent to 'monom'.
std::pair< const int *, bool > findOrInsert(const int *monom)
MonomialHashAndEqVarSize mMonomialHashAndEq
std::size_t numElements() const
number of (unique) monomials in this set.
std::unordered_set< const int *, MonomialHashAndEqVarSize, MonomialHashAndEqVarSize > mHash
Hash set of interned variable-size monomials — the variable-length counterpart of MonomialSetFixedSiz...
VALGRIND_MAKE_MEM_DEFINED & result(result)