cLCG32 Class Reference
#include <clcg32.h>
List of all members.
Detailed Description
Implements a 32-bit (2^31-2 cycle length) linear congruential random number generator.
- Range: 1 ... 2^31-2
- Period length: 2^31-2
- Method: x=(x * 7^5) mod (2^31-1)
- Required hardware: exactly 32-bit integer aritmetics
- To check: if x[0]=1 then x[10000]=1,043,618,065
Source: Raj Jain: The Art of Computer Systems Performance Analysis (John Wiley & Sons, 1991) pp 441-444, 455.
Member Function Documentation
| virtual void cLCG32::initialize |
( |
int |
seedSet, |
|
|
int |
rngId, |
|
|
int |
numRngs, |
|
|
int |
parsimProcId, |
|
|
int |
parsimNumPartitions, |
|
|
cConfiguration * |
cfg | |
|
) |
| | [virtual] |
Sets up the RNG.
Implements cRNG.
| virtual void cLCG32::selfTest |
( |
|
) |
[virtual] |
Tests correctness of the RNG.
Implements cRNG.
| virtual unsigned long cLCG32::intRand |
( |
|
) |
[virtual] |
| virtual unsigned long cLCG32::intRandMax |
( |
|
) |
[virtual] |
Maximum value that can be returned by intRand().
Implements cRNG.
| virtual unsigned long cLCG32::intRand |
( |
unsigned long |
n |
) |
[virtual] |
| virtual double cLCG32::doubleRand |
( |
|
) |
[virtual] |
Random double on the [0,1) interval.
Implements cRNG.
| virtual double cLCG32::doubleRandNonz |
( |
|
) |
[virtual] |
Random double on the (0,1) interval.
Implements cRNG.
| virtual double cLCG32::doubleRandIncl1 |
( |
|
) |
[virtual] |
Random double on the [0,1] interval.
Implements cRNG.
The documentation for this class was generated from the following file: