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
) constnodiscardnoexcept[¶]

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::next_uint64()nodiscardnoexcept[¶]

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

uint32_t BLRandom::next_uint32()nodiscardnoexcept[¶]

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

double BLRandom::next_double()nodiscardnoexcept[¶]

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

uint64_t BLRandom::data[2][¶]

PRNG state.