struct Alea::Core::Mulberry32(N)
- Alea::Core::Mulberry32(N)
- Struct
- Value
- Object
Overview
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]
Defined in:
alea/core/cgen.crConstructors
Class Method Summary
-
.init_state(seed : UInt32)
Generate a state to be used by PRNGs as a
StaticArray(UInt32, N)
.
Instance Method Summary
Constructor Detail
Class Method Detail
def self.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
.