A pseudo random number generator using the linear congruential algorithm with the following parameters: More...
Public Types | |
typedef uint32_t | result_type |
The type of the generated random value. More... | |
Public Member Functions | |
Rand48 (uint32_t val=default_seed) | |
Construct with specified or default seed. More... | |
void | seed (uint32_t val=default_seed) |
Reseed the generator. More... | |
void | discard (unsigned long long z) |
Advance the state of the generator by z notches. More... | |
uint64_t | raw () |
Get the next random number in the sequence and return its raw 48-bit value. More... | |
uint32_t | operator() () |
Get the next random number in the sequence. More... | |
Static Public Member Functions | |
static constexpr uint32_t | min () |
The smallest value that the generator can produce. More... | |
static constexpr uint32_t | max () |
The largest value that the generator can produce. More... | |
Static Public Attributes | |
static constexpr result_type | default_seed = 1u |
The default seed. More... | |
A pseudo random number generator using the linear congruential algorithm with the following parameters:
Xn+1 = (aXn + c) mod m, where n >= 0 a = 0x5DEECE66D, c = 0xB m = 2**48
It delivers results identical to the lrand48()
function that is available on some systems.
typedef uint32_t result_type |
|
inlineexplicit |
|
inlinestatic |
|
inlinestatic |
|
inline |
Reseed the generator.
Definition at line 124 of file Rand48.H.
Referenced by Random::Random().
|
inline |
|
inline |
|
inline |
|
static |
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.