51llvm::cl::opt<unsigned> RNGInitialSeed(
52 "rng-initial-seed", llvm::cl::init(5489U),
53 llvm::cl::desc(
"seed value for random number generator (default=5489)"),
68 mt[0]= s & 0xffffffffUL;
76 mt[
mti] &= 0xffffffffUL;
84 static unsigned int mag01[2]={0x0UL,
MATRIX_A};
90 for (kk=0;kk<
N-
M;kk++) {
92 mt[kk] =
mt[kk+
M] ^ (y >> 1U) ^ mag01[y & 0x1UL];
96 mt[kk] =
mt[kk+(
M-
N)] ^ (y >> 1U) ^ mag01[y & 0x1UL];
99 mt[
N-1] =
mt[
M-1] ^ (y >> 1U) ^ mag01[y & 0x1UL];
108 y ^= (y << 7U) & 0x9d2c5680UL;
109 y ^= (y << 15U) & 0xefc60000UL;
122 return getInt32()*(1.0/4294967295.0);
128 return getInt32()*(1.0/4294967296.0);
134 return (((
double)
getInt32()) + 0.5)*(1.0/4294967296.0);
139 return getInt32()*(1.0f/4294967295.0f);
143 return getInt32()*(1.0f/4294967296.0f);
147 return (
getInt32() + 0.5f)*(1.0f/4294967296.0f);
static const unsigned int LOWER_MASK
void seed(unsigned int seed)
static const unsigned int UPPER_MASK
static const unsigned int MATRIX_A
llvm::cl::OptionCategory MiscCat