random number generator of L'Ecuyer with Bays-Durham shuffle and added safeguards (numeric recipes) More...
Go to the source code of this file.
Defines | |
#define | IM1 2147483563 |
#define | IM2 2147483399 |
#define | AM (1.0/IM1) |
#define | IMM1 (IM1-1) |
#define | IA1 40014 |
#define | IA2 40692 |
#define | IQ1 53668 |
#define | IQ2 52774 |
#define | IR1 12211 |
#define | IR2 3791 |
#define | NTAB 32 |
#define | NDIV (1+IMM1/NTAB) |
#define | EPS 1.2e-7 |
#define | RNMX (1.0-EPS) |
#define | MODMULT(a, b, c, m, s) q = s/a; s = b*(s-a*q)-c*q; if (s < 0) s += m; |
Functions | |
double | ran2 (long *idum) |
Long period (> 2.0e18) random number generator of L'Ecuyer with Bays-Durham shuffle and added safeguards. Returns a uniform random deviate between 0.0 and 1.0 (exclusive of the endpoints). | |
unsigned short | random (long *seed, unsigned short max) |
returns a random value between zero and max, Long period (> 2.0e18) (see ran2()) | |
uint32_t | randomUInt32 (long *seed, uint32_t max) |
double | combinedLCG (void) |
void | initLCG (long init_s1, long init_s2) |
Variables | |
static long | CF_MM_s1 = 1 |
static long | CF_MM_s2 = 1 |
Definition in file random.h.
#define MODMULT | ( | a, | |||
b, | |||||
c, | |||||
m, | |||||
s | ) | q = s/a; s = b*(s-a*q)-c*q; if (s < 0) s += m; |
Definition at line 256 of file random.h.
Referenced by combinedLCG().
double combinedLCG | ( | void | ) |
void initLCG | ( | long | init_s1, | |
long | init_s2 | |||
) |
uint32_t randomUInt32 | ( | long * | seed, | |
uint32_t | max | |||
) | [inline] |
Definition at line 214 of file random.h.
References ran2().
Referenced by CFPointFilter::addFilterRule(), and CFPointFilter::pointPassedFilter().
long CF_MM_s1 = 1 [static] |
Definition at line 253 of file random.h.
Referenced by combinedLCG(), and initLCG().
long CF_MM_s2 = 1 [static] |
Definition at line 254 of file random.h.
Referenced by combinedLCG(), and initLCG().