Alea::Core::Mulberry32(N)
Inherits Struct / Value / Object
Mulberry32(N) generator to initialize a N sized state for the pseudo-random number generators.
NOTE: N refers to the size in bits of the state divided by 32.
The algorithm comes from https://gist.github.com/tommyettinger/46a874533244883189143505d203312c.
state = Alea::Core::Mulberry32(4).init_state 93u32
state # => StaticArray[1079867279, 1912516084, 2459043021, 3508473169]
Constructors
new
SourceClass methods
init_state(seed : UInt32)
Generate a state to be used by PRNGs as a StaticArray(UInt32, N).
@parameters:
seed: initial seed; it must be anUInt32.
Instance methods
initialize
Source