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

Member Function Documentation

BLResult BLRandom::reset(uint64_t seed = 0)◆ 

Resets the random number generator to the given seed.

Always returns BL_SUCCESS.

bool BLRandom::equals(const BLRandom& other) const◆ 

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()◆ 

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

uint32_t BLRandom::nextUInt32()◆ 

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

double BLRandom::nextDouble()◆ 

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

Member Data Documentation

uint64_t BLRandom::data[2]◆ 

PRNG state.