The original MT19937 mixing functionality. More...
#include <RandomLib-2010-01/RandomMixer.hpp>
Public Types | |
typedef RandomType | mixer_t |
Static Public Member Functions | |
static void | SeedToState (const std::vector< RandomSeed::seed_type > &seed, mixer_type state[], unsigned n) throw () |
static std::string | Name () throw () |
Static Public Attributes | |
static const unsigned | version = 0x4d784d54UL + (mixer_t::width == 64) |
Private Types | |
typedef mixer_t::type | mixer_type |
Private Attributes | |
static const mixer_type | a1 = 19650218UL |
static const mixer_type | b = mixer_t::width == 32 ? 1812433253ULL : 6364136223846793005ULL |
static const mixer_type | c = mixer_t::width == 32 ? 1664525ULL : 3935559000370003845ULL |
static const mixer_type | d = mixer_t::width == 32 ? 1566083941ULL : 2862933555777941757ULL |
Static Private Attributes | |
static const mixer_type | mask = mixer_t::mask |
static const mixer_type | a0 = 5489ULL |
The original MT19937 mixing functionality.
This implements the functionality of init_by_array in MT19937 http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/mt19937ar.c and init_by_array64 in MT19937_64 http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/VERSIONS/C-LANG/mt19937-64.c with the following changes:
The template parameter RandomType switches between the 32-bit and 64-bit versions.
MixerMT0 is specific to the MT19937 generators and should not be used for other generators (e.g., SFMT19937). In addition, MixerMT0 has known defects and should only be used to check the operation of the MT19937 engines against the original implementation. These defects are described in the MixerMT1 which is a modification of MixerMT0 which corrects these defects. For production use MixerMT1 or, perferably, MixerSFMT should be used.
The RandomType controlling the output of MixerMT1::SeedToState
Definition at line 61 of file RandomMixer.hpp.
typedef mixer_t::type RandomLib::MixerMT0::mixer_type [private] |
The unsigned type corresponding to mixer_t.
Definition at line 72 of file RandomMixer.hpp.
void RandomLib::MixerMT0::SeedToState | ( | const std::vector< RandomSeed::seed_type > & | seed, |
mixer_type | state[], | ||
unsigned | n | ||
) | throw () [static] |
Mix the seed vector, seed, into the state array, state, of size n.
Definition at line 524 of file Random.cpp.
static std::string RandomLib::MixerMT0::Name | ( | ) | throw () [inline, static] |
Return the name of this class.
Definition at line 87 of file RandomMixer.hpp.
References RandomLib::RandomType::width.
const unsigned RandomLib::MixerMT0::version = 0x4d784d54UL + (mixer_t::width == 64) [static] |
A version number which should be unique to this RandomMixer. This prevents RandomEngine::Load from loading a saved generator with a different RandomMixer. Here the version is "MxMT" or "MxMU".
Definition at line 67 of file RandomMixer.hpp.
const mixer_type RandomLib::MixerMT0::mask = mixer_t::mask [static, private] |
The mask for mixter_t.
Definition at line 76 of file RandomMixer.hpp.
const mixer_type RandomLib::MixerMT0::a0 = 5489ULL [static, private] |
Definition at line 92 of file RandomMixer.hpp.
const mixer_type RandomLib::MixerMT0::a1 = 19650218UL [private] |
Definition at line 92 of file RandomMixer.hpp.
const mixer_type RandomLib::MixerMT0::b = mixer_t::width == 32 ? 1812433253ULL : 6364136223846793005ULL [private] |
Definition at line 93 of file RandomMixer.hpp.
const mixer_type RandomLib::MixerMT0::c = mixer_t::width == 32 ? 1664525ULL : 3935559000370003845ULL [private] |
Definition at line 94 of file RandomMixer.hpp.
const mixer_type RandomLib::MixerMT0::d = mixer_t::width == 32 ? 1566083941ULL : 2862933555777941757ULL [private] |
Definition at line 95 of file RandomMixer.hpp.