RandomLib  1.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
RandomLib::MixerMT0< RandomType > Class Template Reference

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)
 

Detailed Description

template<class RandomType>
class RandomLib::MixerMT0< RandomType >

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.

Template Parameters
RandomTypethe type of the results, either Random_u32 or Random_u64.

Definition at line 59 of file RandomMixer.hpp.

Member Typedef Documentation

template<class RandomType >
typedef RandomType RandomLib::MixerMT0< RandomType >::mixer_t

The RandomType controlling the output of MixerMT0::SeedToState

Definition at line 64 of file RandomMixer.hpp.

Member Function Documentation

template<class RandomType >
void RandomLib::MixerMT0< RandomType >::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.

Parameters
[in]seedthe input seed vector.
[out]statethe generator state.
[in]nthe size of the state.

Definition at line 523 of file Random.cpp.

template<class RandomType >
static std::string RandomLib::MixerMT0< RandomType >::Name ( )
inlinestatic

Return the name of this class.

Returns
the name.

Definition at line 96 of file RandomMixer.hpp.

Member Data Documentation

template<class RandomType >
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 70 of file RandomMixer.hpp.


The documentation for this class was generated from the following files: