MersenneTwisterEngine

The Mersenne Twister generator, developed by Makoto Matsumoto and Takuji Nishimura (1997), allows for fast generation of high-quality pseudorandom numbers, and is widely used as a default random number generator by many programming languages, including D. The current implementation is adapted from that of Boost.Random and supports both 32- and 64-bit datatypes.

Constructors

this
this()

Constructs a MersenneTwisterEngine using the default seed.

this
this(UIntType value)

Constructs a MersenneTwisterEngine seeded with value.

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 value)
Undocumented in source. Be warned that the author may not have intended to support it.
seed
void seed(Range range)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

defaultSeed
enum UIntType defaultSeed;

Default seed value

empty
enum bool empty;

Always false (random number generators are infinite ranges).

initializationMultiplier
enum UIntType initializationMultiplier;
Undocumented in source.
isUniformRandom
enum bool isUniformRandom;

Mark this as a uniform RNG

maskBits
enum size_t maskBits;
Undocumented in source.
max
enum UIntType max;

Largest generated value

min
enum UIntType min;

Smallest generated value (0)

shiftSize
enum size_t shiftSize;
Undocumented in source.
stateSize
enum size_t stateSize;
Undocumented in source.
temperingB
enum UIntType temperingB;
Undocumented in source.
temperingC
enum UIntType temperingC;
Undocumented in source.
temperingD
enum UIntType temperingD;
Undocumented in source.
temperingL
enum size_t temperingL;
Undocumented in source.
temperingS
enum size_t temperingS;
Undocumented in source.
temperingT
enum size_t temperingT;
Undocumented in source.
temperingU
enum size_t temperingU;
Undocumented in source.
wordSize
enum size_t wordSize;

Parameters for the generator

xorMask
enum UIntType xorMask;
Undocumented in source.

Meta