The OpenD Programming Language

PermutedCongruentialEngine

The PermutedCongruentialEngine:

Constructors

this
this(Uint seed, Uint stream_)
this
this(Uint seed)

Postblit

A postblit is present on this object, but not explicitly documented in the 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;
period_pow2
enum period_pow2;

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;

Mixed In Members

From mixin no_stream!Uint

is_mcg
enum is_mcg;
increment
enum Uint increment;
can_specify_stream
enum can_specify_stream;
streams_pow2
enum size_t streams_pow2;

From mixin unique_stream!Uint

is_mcg
enum is_mcg;
increment
Uint increment [@property getter]
stream
Uint stream()
can_specify_stream
enum can_specify_stream;
streams_pow2
enum size_t streams_pow2;

From mixin specific_stream!Uint

is_mcg
enum is_mcg;
inc_
Uint inc_;
increment
alias increment = inc_
can_specify_stream
enum can_specify_stream;
set_stream
void set_stream(Uint u)
streams_pow2
enum size_t streams_pow2;

From mixin oneseq_stream!Uint

is_mcg
enum is_mcg;
increment
enum Uint increment;
can_specify_stream
enum can_specify_stream;
streams_pow2
enum size_t streams_pow2;

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