|
| | mtwister () |
| | Default constructor, reading seed from/dev/urandom or the time. More...
|
| |
| | mtwister (uint32_t seed) |
| | Default constructor, with optional seed. More...
|
| |
| virtual void | init (uint32_t seed) |
| | Initializes the generator with "seed". More...
|
| |
| uint32_t | get_rand () |
| | Get the next integer. More...
|
| |
| | prng () |
| | Default constructor, reading seed from/dev/urandom or the time. More...
|
| |
| | prng (uint32_t seed) |
| | Default constructor, with optional seed. More...
|
| |
| uint32_t | get_seed () |
| | Returns the original seed value. More...
|
| |
| uint32_t | get_rand_range (uint32_t lo, uint32_t hi) |
| | Get the next integer in the range [lo,hi]. More...
|
| |
| size_t | get_rand_index (size_t length) |
| | Get the next random value as a size_t index. More...
|
| |
| double | get_rand_real1 () |
| | Get the next number in the range [0,1]. More...
|
| |
| double | get_rand_real2 () |
| | Get the next number in the range [0,1) More...
|
| |
| double | get_rand_real3 () |
| | Get the next number in the range (0,1) More...
|
| |
| double | get_rand_real53 () |
| | Get the next number in the range [0,1) More...
|
| |
|
|
static const size_t | N = 624 |
| |
|
static const size_t | M = 397 |
| |
|
static const uint32_t | MATRIX_A = 0x9908b0dfUL |
| |
|
static const uint32_t | UPPER_MASK = 0x80000000UL |
| |
|
static const uint32_t | LOWER_MASK = 0x7fffffffUL |
| |
|
|
uint32_t | m_seed |
| | Initialization seed.
|
| |
| libcoyotl::mtwister::mtwister |
( |
| ) |
|
The constructor initializes the prng seed from either the time or some stochastic source such as /dev/random or /dev/urandom.
| libcoyotl::mtwister::mtwister |
( |
uint32_t |
seed | ) |
|
The constructor uses an explicit value for the seed.
- Parameters
-
| seed | - Seed value used to "start" or seed the generator |
| uint32_t libcoyotl::mtwister::get_rand |
( |
| ) |
|
|
virtual |
Returns the next uint32_t in sequence.
- Returns
- A pseudorandom uint32_t value
Implements libcoyotl::prng.
| virtual void libcoyotl::mtwister::init |
( |
uint32_t |
seed | ) |
|
|
virtual |
Resets the generator using the provided seed value.
- Parameters
-
| seed | - Seed value used to "start" or seed the generator |
Reimplemented from libcoyotl::prng.
The documentation for this class was generated from the following file: