class

Random::PCG32

Inherits Random / Reference / Object

pcg32_random_r: - result: 32-bit unsigned int (uint32_t) - period: 2^64 (* 2^63 streams) - state type: pcg32_random_t (16 bytes) - output func: XSH-RR

Constants

PCG_DEFAULT_MULTIPLIER_64 = 6364136223846793005_u64

Constructors

new(initstate : UInt64, initseq = 0_u64)
Source

Instance methods

jump(delta)
Source
new_seed(initstate : UInt64, initseq = 0_u64) : UInt32
Source
new_seed

Reseed the generator.

Source
next_u

Generates a random unsigned integer.

The integers must be uniformly distributed between 0 and the maximal value for the chosen type.

Source
split_internal(other : self) : Nil

The internal implementation for #split where self is the original instance and other the duplicated instance to be returned.

The default Random implementation in stdlib is splittable, but not every PRNG algorithm is splittable, so the method raises a NotImplementedError exception by default.

Source