RandomLib
1.10
|
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 () |
Static Public Attributes | |
static const unsigned | version = 0x4d784d54UL + (mixer_t::width == 64) |
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, preferably, MixerSFMT should be used.
RandomType | the type of the results, either Random_u32 or Random_u64. |
Definition at line 59 of file RandomMixer.hpp.
typedef RandomType RandomLib::MixerMT0< RandomType >::mixer_t |
The RandomType controlling the output of MixerMT0::SeedToState
Definition at line 64 of file RandomMixer.hpp.
|
static |
Mix the seed vector, seed, into the state array, state, of size n.
[in] | seed | the input seed vector. |
[out] | state | the generator state. |
[in] | n | the size of the state. |
Definition at line 523 of file Random.cpp.
|
inlinestatic |
|
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 70 of file RandomMixer.hpp.