MTToolBox  0.2.10
Public Member Functions
MTToolBox::AbstractGenerator< U > Class Template Referenceabstract

pseudo random number generator. More...

#include <AbstractGenerator.hpp>

Inheritance diagram for MTToolBox::AbstractGenerator< U >:
MTToolBox::RecursionSearchable< U, V > MTToolBox::RecursionSearchable< U, U > MTToolBox::EquidistributionCalculatable< U, V > MTToolBox::EquidistributionCalculatable< U, U > MTToolBox::ReducibleGenerator< U, V > MTToolBox::TemperingCalculatable< U, V > MTToolBox::ReducibleGenerator< U > MTToolBox::TemperingCalculatable< U > MTToolBox::ReducibleTemperingCalculatable< U > MTToolBox::ReducibleTemperingCalculatable< U >

Public Member Functions

virtual ~AbstractGenerator ()
 Virtual destructor (always required) More...
 
virtual U generate ()=0
 transit current internal state to next state and output a pseudo random number. More...
 
virtual void seed (U value)=0
 initialize internal state More...
 
virtual int bitSize () const =0
 Return bit size of internal state, i.e dimension of GF(2)-vector space. More...
 

Detailed Description

template<class U>
class MTToolBox::AbstractGenerator< U >

pseudo random number generator.

Template Parameters
Uoutput type of a pseudo random number generator.

Constructor & Destructor Documentation

template<class U>
virtual MTToolBox::AbstractGenerator< U >::~AbstractGenerator ( )
inlinevirtual

Virtual destructor (always required)

Member Function Documentation

template<class U>
virtual int MTToolBox::AbstractGenerator< U >::bitSize ( ) const
pure virtual

Return bit size of internal state, i.e dimension of GF(2)-vector space.

It will be Mersenne Exponent, when generator use incomplete array, like Mersenne Twister.

Returns
bit size of internal state

Implemented in MTToolBox::MersenneTwister, MTToolBox::MersenneTwister64, and MTToolBox::Sequential< T >.

Referenced by MTToolBox::AlgorithmEquidistribution< U, V >::AlgorithmEquidistribution(), MTToolBox::calcCharacteristicPolynomial(), MTToolBox::minpoly(), MTToolBox::AlgorithmBestBits< U, V >::operator()(), and MTToolBox::AlgorithmRecursionAndTempering< U, V >::search().

template<class U>
virtual U MTToolBox::AbstractGenerator< U >::generate ( )
pure virtual

transit current internal state to next state and output a pseudo random number.

Returns
a pseudo random number

Implemented in MTToolBox::MersenneTwister64, MTToolBox::MersenneTwister, and MTToolBox::Sequential< T >.

Referenced by MTToolBox::minpoly().

template<class U>
virtual void MTToolBox::AbstractGenerator< U >::seed ( value)
pure virtual

initialize internal state

Initialization function does not need to be a GF(2)-linear function, non-GF(2)-linear function will be suitable. But as far as MTToolBox concerned, initialization only need to assure that the internal state is not zero. When generator use incomplete array, like Mersenne Twister, really used part of array should be set non-zero.

Parameters
[in]valueseed of initialization

Implemented in MTToolBox::MersenneTwister64, MTToolBox::MersenneTwister, and MTToolBox::Sequential< T >.

Referenced by MTToolBox::TestLinearity< U, V >::operator()().


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