The original MT19937 mixing functionality. More...
#include <RandomLib/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 |
Static Private Attributes | |
static const mixer_type | mask = mixer_t::mask |
static const mixer_type | a0 = 5489ULL |
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 |
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.
Definition at line 57 of file RandomMixer.hpp.
typedef RandomType RandomLib::MixerMT0< RandomType >::mixer_t |
The RandomType controlling the output of MixerMT1::SeedToState
Definition at line 62 of file RandomMixer.hpp.
typedef mixer_t::type RandomLib::MixerMT0< RandomType >::mixer_type [private] |
The unsigned type corresponding to mixer_t.
Definition at line 73 of file RandomMixer.hpp.
void RandomLib::MixerMT0< RandomType >::SeedToState | ( | const std::vector< RandomSeed::seed_type > & | seed, | |
mixer_type | state[], | |||
unsigned | n | |||
) | throw () [inline, static] |
Mix the seed vector, seed, into the state array, state, of size n.
Definition at line 525 of file Random.cpp.
static std::string RandomLib::MixerMT0< RandomType >::Name | ( | ) | throw () [inline, static] |
Return the name of this class.
Definition at line 88 of file RandomMixer.hpp.
References RandomLib::RandomType< bits, UIntType >::width.
const unsigned RandomLib::MixerMT0< RandomType >::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 68 of file RandomMixer.hpp.
const mixer_type RandomLib::MixerMT0< RandomType >::mask = mixer_t::mask [static, private] |
The mask for mixter_t.
Definition at line 77 of file RandomMixer.hpp.
const mixer_type RandomLib::MixerMT0< RandomType >::a0 = 5489ULL [static, private] |
Definition at line 93 of file RandomMixer.hpp.
const mixer_type RandomLib::MixerMT0< RandomType >::a1 = 19650218UL [static, private] |
Definition at line 93 of file RandomMixer.hpp.
const mixer_type RandomLib::MixerMT0< RandomType >::b = mixer_t::width == 32 ? 1812433253ULL : 6364136223846793005ULL [static, private] |
Definition at line 94 of file RandomMixer.hpp.
const mixer_type RandomLib::MixerMT0< RandomType >::c = mixer_t::width == 32 ? 1664525ULL : 3935559000370003845ULL [static, private] |
Definition at line 95 of file RandomMixer.hpp.
const mixer_type RandomLib::MixerMT0< RandomType >::d = mixer_t::width == 32 ? 1566083941ULL : 2862933555777941757ULL [static, private] |
Definition at line 96 of file RandomMixer.hpp.