MersenneTwister

The Mersenne Twister is an algorithm for generating random numbers.
Download

MersenneTwister Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • Rick Wagner
  • Publisher web site:
  • http://www-personal.engin.umich.edu/~wagnerr/MersenneTwister.html

MersenneTwister Tags


MersenneTwister Description

The Mersenne Twister is an algorithm for generating random numbers. MersenneTwister is a C++ class for generating random numbers. It was designed with consideration of the flaws in various other generators.The period, 2^19937-1, and the order of equidistribution, 623 dimensions, are far greater. The generator is also fast; it avoids multiplication and division, and it benefits from caches and pipelines. See the inventors' page for more details.I have implemented the Mersenne Twister in a C++ class that is fast, convenient, portable, and free. Take a look at the class or download the complete package in zip or tarball format.Here are some key features of "MersenneTwister":· Simple creation of generator with MTRand r; · Convenient access with double a = r(); · Generation of integers or floating-point numbers · Easy seeding options · Automatically from /dev/urandom or time() and clock() · Single integer · Arrays of any length (to access full 19937-bit range) · Ability to save and restore state · Thorough example program · Validation and performance tests · Open source code under BSD licenseOn my system, a Pentium III running Linux at 500 MHz, the performance test gives the following results for generation of random integers:MersenneTwister.h 28.4 million per secondInventors' C version 14.3 million per secondCokus's optimized C version 16.6 million per secondStandard rand() 6.8 million per second What's New in This Release: · This release focuses on portability and reliability. · Instances of deprecated C++ were cleaned up. · Operations were rewritten to work even in uncommon environments. · The test program was toughened and expanded. · A slight correction was made in the label for the standard deviation parameter. · A copy constructor and operator were added. · Seed correlations, generator functions, output sequences, and save formats are identical to Version 1.0.


MersenneTwister Related Software