LinearCongruentialEngine

Linear congruential generators are some of the oldest algorithms for generating pseudo-random numbers. They tend to be fast but not of particularly high statistical quality, so their use is recommended only in very constrained circumstances, e.g. where memory is very severely restricted. Even then, consider using an Xorshift generator instead, as this should provide much higher statistical quality.

Constructors

this
this()

Constructs a LinearCongruentialEngine using the default seed configuration.

this
this(UIntType x0)

Constructs a LinearCongruentialEngine seeded with x0.

Members

Functions

front
UIntType front()

Returns the current pseudo-random value.

opEquals
bool opEquals(Object rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
popFront
void popFront()

Advances the pseudo-random sequence.

save
typeof(this) save()
Undocumented in source. Be warned that the author may not have intended to support it.
seed
void seed(UIntType x0)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

empty
enum bool empty;

Always false (random number generators are infinite ranges).

increment
enum UIntType increment;
Undocumented in source.
isUniformRandom
enum bool isUniformRandom;
Undocumented in source.
max
enum UIntType max;
Undocumented in source.
min
enum UIntType min;
Undocumented in source.
modulus
enum UIntType modulus;
Undocumented in source.
multiplier
enum UIntType multiplier;
Undocumented in source.

Meta