PermutedCongruentialEngine

The PermutedCongruentialEngine:

Constructors

this
this()
Undocumented in source.
this
this(Uint seed, Uint stream_)
this
this(Uint seed)

Postblit

this(this)
this(this)
Undocumented in source.

Members

Aliases

Uint
alias Uint = TemplateArgsOf!output[1]

Functions

opCall
ReturnType!output opCall()
popFront
void popFront()
seed
void seed(Uint seed)

Compatibility with Phobos library methods. Presents this RNG as an InputRange. Only available if output_previous == true.

skip
void skip(Uint delta)

Skip forward in the random sequence in O(log n) time. Even though delta is an unsigned integer, we can pass a signed integer to go backwards, it just goes "the long way round".

Manifest constants

isRandomEngine
enum isRandomEngine;
max
enum max;
mult
enum mult;
Undocumented in source.
mult
enum mult;
Undocumented in source.
period_pow2
enum period_pow2;

Mixins

__anonymous
mixin no_stream!Uint
Undocumented in source.
__anonymous
mixin unique_stream!Uint
Undocumented in source.
__anonymous
mixin specific_stream!Uint
Undocumented in source.
__anonymous
mixin oneseq_stream!Uint
Undocumented in source.

Properties

front
ReturnType!output front [@property getter]
save
typeof(this) save [@property getter]
empty
enum bool empty;

Compatibility with Phobos library methods. Presents this RNG as an InputRange. Only available if output_previous == true.

Variables

isUniformRandom
enum bool isUniformRandom;
min
enum ReturnType!output min;

Compatibility with Phobos library methods. Presents this RNG as an InputRange. Only available if output_previous == true.

state
Uint state;

Parameters

output

should be one of the above functions. Controls the output permutation of the state.

streamType

one of unique, none, oneseq, specific. Controls the Increment of the LCG portion of the PCG.

output_previous

if true then the pre-advance version (increasing instruction-level parallelism) if false then use the post-advance version (reducing register pressure)

mult_

optionally set the multiplier for the LCG.

Meta