26 #error sizeof(size_t) macro is undefined... At time of writing, this is usually 4 (32 bit) or 8. You can work it out from a simple C++ program which prints out sizeof(size_t). This cant be done automatically due to preprocessor behaviour. 71 #if (SIZEOF_SIZE_T > 4) 101 ASSERT((newMask-3) <
sizeof(maximumLinearTable)/
sizeof(
size_t));
103 maskVal=maximumLinearTable[newMask-3];
107 for(
size_t ui=0;ui<newMask;ui++)
108 totalMask|= (
size_t)(1)<<ui;
120 ASSERT(maxLen < tableLen);
130 for(
size_t n=3;n<tableLen+3;n++)
146 if(period != ((
size_t)(1)<<(n-(
size_t)1)) -(
size_t)(1))
156 lfsr = (lfsr >> 1) ^ ( (-(lfsr & (ull)(1u))) & maskVal );
void setState(size_t newState)
Set the internal lfsr state. Note 0 is the lock-up state.
void setMaskPeriod(unsigned int newMask)
Set the mask to use such that the period is 2^n-1. 3 is minimum 60 is maximum.
size_t clock()
Get a value from the shift register, and advance.
const size_t maximumLinearTable[]
bool verifyTable(size_t maxLen=0)
Check the validity of the table.