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

◆ computeHashValue()

unsigned int MonomialIdeal::computeHashValue ( ) const
protectedvirtual

Implements EngineObject.

Definition at line 28 of file monideal.cpp.

29{
30 // Incorporate the size and the first 5 elements
31 unsigned int hashval = size();
32 int count = 0;
33 for (Bag& b : *this)
34 {
35 if (count >= 5) break;
36 const_varpower m = b.monom().data();
37 hashval = 4436435 * hashval + varpower::computeHashValue(m);
38 count++;
39 }
40 return hashval;
41}
varpower::ConstExponents const_varpower
static HashExponent computeHashValue(ConstExponents vp)
int size() const
Definition monideal.hpp:186
gc_vector< int > & monom()
Definition int-bag.hpp:60
int_bag Bag
Definition int-bag.hpp:70

References ExponentList< int, true >::computeHashValue(), count, int_bag::monom(), and size().