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

◆ computeHashValue()

unsigned int Monoid::computeHashValue ( const_monomial m) const

Definition at line 349 of file monoid.cpp.

350{
351 unsigned int seed = 0x3124252;
352 unsigned int hash = 0x43435728;
353 int len = monomial_size();
354 for (int i = 0; i < len; i++)
355 {
356 unsigned int val = *m++;
357 hash += seed * val;
358 seed = seed + 1342234;
359 }
360 return hash;
361}
int monomial_size() const
Definition monoid.hpp:209
unsigned int hash() const
Definition hash.hpp:106

References MutableEngineObject::hash(), and monomial_size().

Referenced by PolynomialRing::computeHashValue().