mitsuba-af602c6fd98a/src/libcore/random.cpp
/** Compute a hash value representing the SFMT parameters */
Compute a hash value representing the SFMT parameters
Compute a hash value representing the SFMT parameters
inline uint32_t sfmtHash() {
	const uint32_t data[] =
		{MEXP, POS1, SL1, SL2, SR1, SR2, MSK1, MSK2, MSK3, MSK4};
	uint32_t hash = 17;
	for (int i = 0; i < 10; ++i)
		hash ^= data[i] + 0x9e3779b9U + (hash<<6) + (hash>>2);
	return hash;
}
inline uint32_t sfmtHash ( ) { const uint32_t data [ ] = { MEXP , POS1 , SL1 , SL2 , SR1 , SR2 , MSK1 , MSK2 , MSK3 , MSK4 } ; uint32_t hash = 17 ; for ( int i = 0 ; i < 10 ; ++ i ) hash ^= data [ i ] + 0x9e3779b9U + ( hash << 6 ) + ( hash >> 2 ) ; return hash ; }
Compute a hash value representing the SFMT parameters
Compute a hash value representing the SFMT parameters
// Based on boost::hash_combine