View source code Display the source code in std/random.d from which this page was generated on github. Improve this page Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone. Page wiki View or edit the community-maintained wiki page associated with this page.

std.random.mersenne_twister_engine.seed - multiple declarations

Template MersenneTwisterEngine.seed

Seeds a MersenneTwisterEngine object.

Arguments

template seed();

Functions

Function name Description
seed

Note

This seed function gives 2^32 starting points. To allow the RNG to be started in any one of its internal states use the seed overload taking an InputRange.

Template MersenneTwisterEngine.seed

Seeds a MersenneTwisterEngine object using an InputRange.

Arguments

template seed(T);

Functions

Function name Description
seed

Throws

Exception if the InputRange didn't provide enough elements to seed the generator. The number of elements required is the 'n' template parameter of the MersenneTwisterEngine struct.

Examples

Mt19937 gen;
gen.seed(map!((a) => unpredictableSeed)(repeat(0)));

Authors

Andrei Alexandrescu Masahiro Nakagawa (Xorshift random generator) Joseph Rushton Wakeling (Algorithm D for random sampling)

License

Boost License 1.0.

Comments