MTToolBox  0.2.10
Public Member Functions
MTToolBox::EquidistributionCalculatable< U, V > Class Template Referenceabstract

This class is an Abstract class for calculating dimension of equi-distribution for GF(2)-linear pseudo random number generators. More...

#include <EquidistributionCalculatable.hpp>

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

Public Member Functions

virtual ~EquidistributionCalculatable ()
 Virtual destructor (always required) More...
 
virtual EquidistributionCalculatable< U, V > * clone () const =0
 Return copy of myself. More...
 
virtual U generate (int outBitLen)=0
 output outBitLen from MSB. More...
 
virtual void add (EquidistributionCalculatable< U, V > &that)=0
 Add internal state of GF(2)-linear pseudo random number generators. More...
 
virtual void setZero ()=0
 Set all zero to internal state. More...
 
virtual bool isZero () const =0
 Check if bits in internal state are all zero. More...
 
- Public Member Functions inherited from MTToolBox::RecursionSearchable< U, V >
virtual ~RecursionSearchable ()
 Virtual destructor (always required) More...
 
virtual void setUpParam (AbstractGenerator< V > &generator)=0
 Users should set parameters for their generator when this method is called. More...
 
virtual const std::string getHeaderString ()=0
 Returns header string of parameters. More...
 
virtual const std::string getParamString ()=0
 Returns string expression of parameters. More...
 
- Public Member Functions inherited from MTToolBox::AbstractGenerator< U >
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<typename U, typename V = U>
class MTToolBox::EquidistributionCalculatable< U, V >

This class is an Abstract class for calculating dimension of equi-distribution for GF(2)-linear pseudo random number generators.

Template Parameters
Utype of output of pseudo random number generator, should be unsinged number.
Vtype of oiutput of parameter generator.

Constructor & Destructor Documentation

template<typename U, typename V = U>
virtual MTToolBox::EquidistributionCalculatable< U, V >::~EquidistributionCalculatable ( )
inlinevirtual

Virtual destructor (always required)

Member Function Documentation

template<typename U, typename V = U>
virtual void MTToolBox::EquidistributionCalculatable< U, V >::add ( EquidistributionCalculatable< U, V > &  that)
pure virtual

Add internal state of GF(2)-linear pseudo random number generators.

Warning
When keeping internal state in an array and using index for round robbin, adding shoud be relative to index like:
for (int i = 0; i < size; i++) {
  state[(index + i) % size] ^= that.state[(that.index + i) % size];
}

Referenced by MTToolBox::annihilate().

template<typename U, typename V = U>
virtual EquidistributionCalculatable<U, V>* MTToolBox::EquidistributionCalculatable< U, V >::clone ( ) const
pure virtual

Return copy of myself.

Returns
copy of myself.

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

template<typename U, typename V = U>
virtual U MTToolBox::EquidistributionCalculatable< U, V >::generate ( int  outBitLen)
pure virtual

output outBitLen from MSB.

Remained bits should be all zeros. Users should call statte transition function inside this method.

Parameters
[in]outBitLenShows how many bits are outputed.
Returns
an integer whose outBiteLen bits from MSB.

Referenced by MTToolBox::annihilate().

template<typename U, typename V = U>
virtual bool MTToolBox::EquidistributionCalculatable< U, V >::isZero ( ) const
pure virtual

Check if bits in internal state are all zero.

When using an incomplete array like Mersenne Twister, user should check bits in true internal state.

template<typename U, typename V = U>
virtual void MTToolBox::EquidistributionCalculatable< U, V >::setZero ( )
pure virtual

Set all zero to internal state.

Referenced by MTToolBox::annihilate().


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