A pseudo random number generator using the linear congruential algorithm with the following parameters: More...
#include <Rand48.H>
Public Types | |
| typedef uint32_t | result_type |
| The type of the generated random value. | |
Public Member Functions | |
| Rand48 (uint32_t val=default_seed) | |
| Construct with specified or default seed. | |
| void | seed (uint32_t val=default_seed) |
| Reseed the generator. | |
| void | discard (unsigned long long z) |
Advance the state of the generator by z notches. | |
| uint64_t | raw () |
| Get the next random number in the sequence and return its raw 48-bit value. | |
| uint32_t | operator() () |
| Get the next random number in the sequence. | |
Static Public Member Functions | |
| static constexpr uint32_t | min () |
| The smallest value that the generator can produce. | |
| static constexpr uint32_t | max () |
| The largest value that the generator can produce. | |
Static Public Attributes | |
| static constexpr result_type | default_seed = 1u |
| The default seed. | |
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 |
Construct with specified or default seed.
Definition at line 103 of file Rand48.H.
References default_seed.
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inline |
|
inline |
|
inline |
|
inline |
|
staticconstexpr |