Skip to content

PCG

Index

Public

# RandomNumbers.PCGModule.

The module for PCG Family.

source

# RandomNumbers.PCG.PCGMethodConstant.

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.

source

# RandomNumbers.PCG.PCG_LISTConstant.

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

source

# RandomNumbers.PCG.PCGStateMCGType.

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.

source

# RandomNumbers.PCG.PCGStateOneseqType.

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.

source

# RandomNumbers.PCG.PCGStateSetseqType.

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 Integers 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.

source

# RandomNumbers.PCG.PCGStateUniqueType.

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.

source

# RandomNumbers.PCG.PCG_RXS_M_XSType.

One of PCG output method: random xorshift, mcg multiply, fixed xorshift.

The most statistically powerful generator, but slower than some of the others.

source

# RandomNumbers.PCG.PCG_XSH_RRType.

One of PCG output method: high xorshift, followed by a random rotate.

Fast. Slightly better statistically than PCG_XSH_RS.

source

# RandomNumbers.PCG.PCG_XSH_RSType.

One of PCG output method: high xorshift, followed by a random shift.

Fast.

source

# RandomNumbers.PCG.PCG_XSL_RRType.

One of PCG output method: fixed xorshift (to low bits), random rotate.

Useful for 128-bit types that are split across two CPU registers.

source

# RandomNumbers.PCG.PCG_XSL_RR_RRType.

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.

source

# 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

source

# RandomNumbers.PCG.bounded_randMethod.

bounded_rand(r, bound)

Producing a random number less than a given bound in the output type.

source

Internal

# RandomNumbers.PCG.AbstractPCGType.

AbstractPCG{StateType<:PCGUInt, MethodType<:PCGMethod, OutputType<:PCGUInt} <: AbstractRNG{OutputType}

The base abstract type for PCGs.

source

# RandomNumbers.PCG.default_incrementMethod.

Return the default increment for a certain type.

source

# RandomNumbers.PCG.default_multiplierMethod.

Return the default multiplier for a certain type.

source

# RandomNumbers.PCG.mcg_multiplierMethod.

Return the default MCG multiplier for a certain type.

source

# RandomNumbers.PCG.mcg_unmultiplierMethod.

Return the default MCG unmultiplier for a certain type.

source

# RandomNumbers.PCG.pcg_advance!Function.

Advance a PCG object.

source

# RandomNumbers.PCG.pcg_advance_lcgMethod.

General advance functions.

source

# RandomNumbers.PCG.pcg_outputFunction.

Return the output of a state for a certain PCG type.

source

# RandomNumbers.PCG.pcg_seed!Function.

Initialize a PCG object.

source

# RandomNumbers.PCG.pcg_step!Function.

Do one iteration step for a PCG object.

source