class Alea::ZPF6329
- Alea::ZPF6329
- Reference
- Object
Included Modules
- Alea::PRNG(UInt32, UInt64)
Defined in:
engines/zpf6329.crConstant Summary
-
STATE_STORAGE_32 =
4
-
STATE_STORAGE_64 =
2
Constructors
-
.new(seed32 : UInt32, seed64 : UInt64)
Initializes the PRNG with initial seeds.
-
.new(seed32 : Int, seed64 : Int)
Initializes the PRNG with initial seeds.
-
.new(seed : Int)
Initializes the PRNG with initial seed.
-
.new
Initializes the PRNG with initial seeds readed from system resources.
Class Method Summary
-
.secure
Returns an instamce of this PRNG with initial seeds readed from system resources.
Instance Method Summary
-
#next_u32 : UInt32
Generate a uniform-distributed random
UInt32
. -
#next_u64 : UInt64
Generate a uniform-distributed random
UInt64
.
Constructor Detail
def self.new(seed32 : UInt32, seed64 : UInt64)
#
Initializes the PRNG with initial seeds.
@parameters:
seed32
: value as input to init. the state of 32-bit generators.seed64
: value as input to init. the state of 64-bit generators.
@references:
Alea::Mulberry32(4)#init_state
.Alea::SplitMix64(2)#init_state
.
@exceptions:
Alea::UndefinedError
if any ofseed32
orseed64
is negative.
def self.new(seed32 : Int, seed64 : Int)
#
Initializes the PRNG with initial seeds.
@parameters:
seed32
: value as input to init. the state of 32-bit generators ofprng
.seed64
: value as input to init. the state of 64-bit generators ofprng
.
def self.new(seed : Int)
#
Initializes the PRNG with initial seed.
@parameters:
seed
: initial seed as input for generating the state ofprng
.
Class Method Detail
Instance Method Detail
def next_u32 : UInt32
#
Generate a uniform-distributed random UInt32
.
@examples:
rng = Alea::ZPF6329.new
rng.next_u32 # => 1767702788
def next_u64 : UInt64
#
Generate a uniform-distributed random UInt64
.
@examples:
rng = Alea::ZPF6329.new
rng.next_u64 # => 9136120204379184874