PCG
Index
RandomNumbers.PCG
RandomNumbers.PCG.PCGMethod
RandomNumbers.PCG.PCG_LIST
RandomNumbers.PCG.AbstractPCG
RandomNumbers.PCG.PCGStateMCG
RandomNumbers.PCG.PCGStateOneseq
RandomNumbers.PCG.PCGStateSetseq
RandomNumbers.PCG.PCGStateUnique
RandomNumbers.PCG.PCG_RXS_M_XS
RandomNumbers.PCG.PCG_XSH_RR
RandomNumbers.PCG.PCG_XSH_RS
RandomNumbers.PCG.PCG_XSL_RR
RandomNumbers.PCG.PCG_XSL_RR_RR
RandomNumbers.PCG.advance!
RandomNumbers.PCG.bounded_rand
RandomNumbers.PCG.default_increment
RandomNumbers.PCG.default_multiplier
RandomNumbers.PCG.mcg_multiplier
RandomNumbers.PCG.mcg_unmultiplier
RandomNumbers.PCG.pcg_advance!
RandomNumbers.PCG.pcg_advance_lcg
RandomNumbers.PCG.pcg_output
RandomNumbers.PCG.pcg_seed!
RandomNumbers.PCG.pcg_step!
Public
#
RandomNumbers.PCG
— Module.
The module for PCG Family.
#
RandomNumbers.PCG.PCGMethod
— Constant.
The Union
of all the PCG method types: PCG_XSH_RS
, PCG_XSH_RR
, PCG_RXS_M_XS
, PCG_XSL_RR
, and PCG_XSL_RR_RR
.
#
RandomNumbers.PCG.PCG_LIST
— Constant.
The list of all the parameter combinations that can be used for PCG.
Stream variation | State Type | Method Type | Output Type |
---|---|---|---|
PCGStateOneseq |
UInt16 |
PCG_XSH_RS |
UInt8 |
PCGStateOneseq |
UInt32 |
PCG_XSH_RS |
UInt16 |
PCGStateOneseq |
UInt64 |
PCG_XSH_RS |
UInt32 |
PCGStateOneseq |
UInt128 |
PCG_XSH_RS |
UInt64 |
PCGStateUnique |
UInt16 |
PCG_XSH_RS |
UInt8 |
PCGStateUnique |
UInt32 |
PCG_XSH_RS |
UInt16 |
PCGStateUnique |
UInt64 |
PCG_XSH_RS |
UInt32 |
PCGStateUnique |
UInt128 |
PCG_XSH_RS |
UInt64 |
PCGStateSetseq |
UInt16 |
PCG_XSH_RS |
UInt8 |
PCGStateSetseq |
UInt32 |
PCG_XSH_RS |
UInt16 |
PCGStateSetseq |
UInt64 |
PCG_XSH_RS |
UInt32 |
PCGStateSetseq |
UInt128 |
PCG_XSH_RS |
UInt64 |
PCGStateMCG |
UInt16 |
PCG_XSH_RS |
UInt8 |
PCGStateMCG |
UInt32 |
PCG_XSH_RS |
UInt16 |
PCGStateMCG |
UInt64 |
PCG_XSH_RS |
UInt32 |
PCGStateMCG |
UInt128 |
PCG_XSH_RS |
UInt64 |
PCGStateOneseq |
UInt16 |
PCG_XSH_RR |
UInt8 |
PCGStateOneseq |
UInt32 |
PCG_XSH_RR |
UInt16 |
PCGStateOneseq |
UInt64 |
PCG_XSH_RR |
UInt32 |
PCGStateOneseq |
UInt128 |
PCG_XSH_RR |
UInt64 |
PCGStateUnique |
UInt16 |
PCG_XSH_RR |
UInt8 |
PCGStateUnique |
UInt32 |
PCG_XSH_RR |
UInt16 |
PCGStateUnique |
UInt64 |
PCG_XSH_RR |
UInt32 |
PCGStateUnique |
UInt128 |
PCG_XSH_RR |
UInt64 |
PCGStateSetseq |
UInt16 |
PCG_XSH_RR |
UInt8 |
PCGStateSetseq |
UInt32 |
PCG_XSH_RR |
UInt16 |
PCGStateSetseq |
UInt64 |
PCG_XSH_RR |
UInt32 |
PCGStateSetseq |
UInt128 |
PCG_XSH_RR |
UInt64 |
PCGStateMCG |
UInt16 |
PCG_XSH_RR |
UInt8 |
PCGStateMCG |
UInt32 |
PCG_XSH_RR |
UInt16 |
PCGStateMCG |
UInt64 |
PCG_XSH_RR |
UInt32 |
PCGStateMCG |
UInt128 |
PCG_XSH_RR |
UInt64 |
PCGStateOneseq |
UInt8 |
PCG_RXS_M_XS |
UInt8 |
PCGStateOneseq |
UInt16 |
PCG_RXS_M_XS |
UInt16 |
PCGStateOneseq |
UInt32 |
PCG_RXS_M_XS |
UInt32 |
PCGStateOneseq |
UInt64 |
PCG_RXS_M_XS |
UInt64 |
PCGStateOneseq |
UInt128 |
PCG_RXS_M_XS |
UInt128 |
PCGStateUnique |
UInt16 |
PCG_RXS_M_XS |
UInt16 |
PCGStateUnique |
UInt32 |
PCG_RXS_M_XS |
UInt32 |
PCGStateUnique |
UInt64 |
PCG_RXS_M_XS |
UInt64 |
PCGStateUnique |
UInt128 |
PCG_RXS_M_XS |
UInt128 |
PCGStateSetseq |
UInt8 |
PCG_RXS_M_XS |
UInt8 |
PCGStateSetseq |
UInt16 |
PCG_RXS_M_XS |
UInt16 |
PCGStateSetseq |
UInt32 |
PCG_RXS_M_XS |
UInt32 |
PCGStateSetseq |
UInt64 |
PCG_RXS_M_XS |
UInt64 |
PCGStateSetseq |
UInt128 |
PCG_RXS_M_XS |
UInt128 |
PCGStateOneseq |
UInt64 |
PCG_XSL_RR |
UInt32 |
PCGStateOneseq |
UInt128 |
PCG_XSL_RR |
UInt64 |
PCGStateUnique |
UInt64 |
PCG_XSL_RR |
UInt32 |
PCGStateUnique |
UInt128 |
PCG_XSL_RR |
UInt64 |
PCGStateSetseq |
UInt64 |
PCG_XSL_RR |
UInt32 |
PCGStateSetseq |
UInt128 |
PCG_XSL_RR |
UInt64 |
PCGStateMCG |
UInt64 |
PCG_XSL_RR |
UInt32 |
PCGStateMCG |
UInt128 |
PCG_XSL_RR |
UInt64 |
PCGStateOneseq |
UInt64 |
PCG_XSL_RR_RR |
UInt64 |
PCGStateOneseq |
UInt128 |
PCG_XSL_RR_RR |
UInt128 |
PCGStateUnique |
UInt64 |
PCG_XSL_RR_RR |
UInt64 |
PCGStateUnique |
UInt128 |
PCG_XSL_RR_RR |
UInt128 |
PCGStateSetseq |
UInt64 |
PCG_XSL_RR_RR |
UInt64 |
PCGStateSetseq |
UInt128 |
PCG_XSL_RR_RR |
UInt128 |
#
RandomNumbers.PCG.PCGStateMCG
— Type.
PCGStateMCG{StateType<:PCGUInt, MethodType<:PCGMethod, OutputType<:PCGUInt} <: AbstractPCG{StateType, MethodType, OutputType} PCGStateMCG([seed]) PCGStateMCG(output_type[, seed]) PCGStateMCG(method[, seed]) PCGStateMCG(output_type[, method, seed])
PCG generator with MCG, where the increment is zero, resulting in a single stream and reduced period.
seed
is an Integer
which will be automatically converted to the state type.
output_type
is the type of the PCG's output. If missing it is set to UInt64
.
method
is one of the PCGMethod
. If missing it is set to PCG_XSH_RS
.
See PCG_LIST
for the available parameter combinations.
#
RandomNumbers.PCG.PCGStateOneseq
— Type.
PCGStateOneseq{StateType<:PCGUInt, MethodType<:PCGMethod, OutputType<:PCGUInt} <: AbstractPCG{StateType, MethodType, OutputType} PCGStateOneseq([seed]) PCGStateOneseq(output_type[, seed]) PCGStateOneseq(method[, seed]) PCGStateOneseq(output_type[, method, seed])
PCG generator with single streams, where all instances use the same fixed constant, thus the RNG always somewhere in same sequence.
seed
is an Integer
which will be automatically converted to the state type.
output_type
is the type of the PCG's output. If missing it is set to UInt64
.
method
is one of the PCGMethod
. If missing it is set to PCG_XSH_RS
.
See PCG_LIST
for the available parameter combinations.
#
RandomNumbers.PCG.PCGStateSetseq
— Type.
PCGStateSetseq{StateType<:PCGUInt, MethodType<:PCGMethod, OutputType<:PCGUInt} <: AbstractPCG{StateType, MethodType, OutputType} PCGStateSetseq([seed]) PCGStateSetseq(output_type[, seed]) PCGStateSetseq(method[, seed]) PCGStateSetseq(output_type[, method, seed])
PCG generator with specific streams, where the constant can be changed at any time, selecting a different random sequence.
seed
is a Tuple
of two Integer
s which will both be automatically converted to the state type.
output_type
is the type of the PCG's output. If missing it is set to UInt64
.
method
is one of the PCGMethod
. If missing it is set to PCG_XSH_RS
.
See PCG_LIST
for the available parameter combinations.
#
RandomNumbers.PCG.PCGStateUnique
— Type.
PCGStateUnique{StateType<:PCGUInt, MethodType<:PCGMethod, OutputType<:PCGUInt} <: AbstractPCG{StateType, MethodType, OutputType} PCGStateUnique([seed]) PCGStateUnique(output_type[, seed]) PCGStateUnique(method[, seed]) PCGStateUnique(output_type[, method, seed])
PCG generator with unique streams, where the constant is based on the memory address of the object, thus every RNG has its own unique sequence.
seed
is an Integer
which will be automatically converted to the state type.
output_type
is the type of the PCG's output. If missing it is set to UInt64
.
method
is one of the PCGMethod
. If missing it is set to PCG_XSH_RS
.
See PCG_LIST
for the available parameter combinations.
#
RandomNumbers.PCG.PCG_RXS_M_XS
— Type.
One of PCG output method: random xorshift, mcg multiply, fixed xorshift.
The most statistically powerful generator, but slower than some of the others.
#
RandomNumbers.PCG.PCG_XSH_RR
— Type.
One of PCG output method: high xorshift, followed by a random rotate.
Fast. Slightly better statistically than PCG_XSH_RS
.
#
RandomNumbers.PCG.PCG_XSH_RS
— Type.
One of PCG output method: high xorshift, followed by a random shift.
Fast.
#
RandomNumbers.PCG.PCG_XSL_RR
— Type.
One of PCG output method: fixed xorshift (to low bits), random rotate.
Useful for 128-bit types that are split across two CPU registers.
#
RandomNumbers.PCG.PCG_XSL_RR_RR
— Type.
One of PCG output method: fixed xorshift (to low bits), random rotate (both parts).
Useful for 128-bit types that are split across two CPU registers. Use this in need of an invertable 128-bit RNG.
#
RandomNumbers.PCG.advance!
— Method.
advance!(r, Δ)
Advance a PCG object r
for Δ
steps.
Examples
julia> r = PCGStateSetseq(UInt64, PCG_RXS_M_XS, (123, 321)) PCGStateSetseq{UInt64,Val{:RXS_M_XS},UInt64}(0x45389f8b27528b29, 0x0000000000000283) julia> A = rand(r, UInt64, 2); julia> p = rand(r); julia> r PCGStateSetseq{UInt64,Val{:RXS_M_XS},UInt64}(0x9b1fc763ae0ad702, 0x0000000000000283) julia> advance!(r, -3) PCGStateSetseq{UInt64,Val{:RXS_M_XS},UInt64}(0x45389f8b27528b29, 0x0000000000000283) julia> @Test.test A == rand(r, UInt64, 2) Test Passed julia> @Test.test p == rand(r) Test Passed
#
RandomNumbers.PCG.bounded_rand
— Method.
bounded_rand(r, bound)
Producing a random number less than a given bound
in the output type.
Internal
#
RandomNumbers.PCG.AbstractPCG
— Type.
AbstractPCG{StateType<:PCGUInt, MethodType<:PCGMethod, OutputType<:PCGUInt} <: AbstractRNG{OutputType}
The base abstract type for PCGs.
#
RandomNumbers.PCG.default_increment
— Method.
Return the default increment for a certain type.
#
RandomNumbers.PCG.default_multiplier
— Method.
Return the default multiplier for a certain type.
#
RandomNumbers.PCG.mcg_multiplier
— Method.
Return the default MCG multiplier for a certain type.
#
RandomNumbers.PCG.mcg_unmultiplier
— Method.
Return the default MCG unmultiplier for a certain type.
#
RandomNumbers.PCG.pcg_advance!
— Function.
Advance a PCG object.
#
RandomNumbers.PCG.pcg_advance_lcg
— Method.
General advance functions.
#
RandomNumbers.PCG.pcg_output
— Function.
Return the output of a state for a certain PCG type.
#
RandomNumbers.PCG.pcg_seed!
— Function.
Initialize a PCG object.
#
RandomNumbers.PCG.pcg_step!
— Function.
Do one iteration step for a PCG object.