IndexMiscellaneousBLRandom
BLRandom Struct Reference

Simple pseudo random number generator based on XORSHIFT+, which has 64-bit seed, 128 bits of state, and full period 2^128 - 1.

Based on a paper by Sebastiano Vigna: http://vigna.di.unimi.it/ftp/papers/xorshiftplus.pdf

Public Members

Member Functions

Construction & Destruction
Overloaded Operators
Common Functionality
Random Numbers

BLResult BLRandom::reset(
uint64_t seed = 0
)noexcept[¶]

Resets the random number generator to the given seed.

Always returns BL_SUCCESS.

bool BLRandom::equals(
const BLRandom& other
) constnoexcept[¶]

Tests whether the random number generator is equivalent to other.

Note
It would return true only when its internal state matches other's internal state.

uint64_t BLRandom::nextUInt64()noexcept[¶]

Returns the next pseudo-random uint64_t value and advances PRNG state.

uint32_t BLRandom::nextUInt32()noexcept[¶]

Returns the next pseudo-random uint32_t value and advances PRNG state.

double BLRandom::nextDouble()noexcept[¶]

Returns the next pseudo-random double precision floating point in [0..1) range and advances PRNG state.

uint64_t BLRandom::data[2][¶]

PRNG state.