mathutil: mersenne.h parameters should not be an enum

This makes no sense as an enum; they're constants, so
they should be static const.
This commit is contained in:
Sam Edwards 2018-09-30 15:43:32 -06:00
parent 183d66a5c2
commit 87d1048f79

View File

@ -69,14 +69,12 @@ PUBLISHED:
};
private:
enum {
// Period parameters
N = 624,
M = 397,
MATRIX_A = 0x9908b0dfUL, // constant vector a
UPPER_MASK = 0x80000000UL, // most significant w-r bits
LOWER_MASK = 0x7fffffffUL, // least significant r bits
};
// Period parameters
static const unsigned long N = 624;
static const unsigned long M = 397;
static const unsigned long MATRIX_A = 0x9908b0dfUL; // constant vector a
static const unsigned long UPPER_MASK = 0x80000000UL; // most significant w-r bits
static const unsigned long LOWER_MASK = 0x7fffffffUL; // least significant r bits
unsigned long mt[N]; // the array for the state vector
unsigned int mti; // mti==N+1 means mt[N] is not initialized