MTToolBox  0.2.10
Public Member Functions
MTToolBox::AlgorithmRecursionAndTempering< U, V > Class Template Reference

#include <AlgorithmRecursionAndTempering.hpp>

Public Member Functions

 AlgorithmRecursionAndTempering (AbstractGenerator< V > &bg, const AlgorithmPrimitivity &primitivity=MersennePrimitivity)
 Constructor. More...
 
bool search (TemperingCalculatable< U, V > &lg, AlgorithmTempering< U, V > &st1, AlgorithmTempering< U, V > &st2, bool verbose=false, std::ostream &os=std::cout, bool no_lsb=false)
 Search parameters for state transition function and parameters for tempering. More...
 
bool search (TemperingCalculatable< U, V > &lg, AlgorithmTempering< U, V > &st, bool verbose=false, std::ostream &os=std::cout)
 Simple wrapper for users who want to search tempering parameter only from MSB. More...
 
int getWeight ()
 Returns Hamming weight of characteristic polynomial of state transition function. More...
 
int getDelta ()
 returns sum of d(v)s, which are difference between k(v) and theoretical upper bound. More...
 
const NTL::GF2X & getCharacteristicPolynomial ()
 Returns characteristic polynomial of state transition function. More...
 

Detailed Description

template<typename U, typename V = U>
class MTToolBox::AlgorithmRecursionAndTempering< U, V >

  1. Search parameters of state transion function of pseudo random number generator so that the characteristic polynomial of the funciton will have max degree and will be primitive.
  2. Search tempering parameters to improve dimension of equi-distribution of output of pseudo random number generator.
Warning
The size of internal state of the generator whose parameters are searched is supporsed to be Mersenne Exponent.
Template Parameters
UType of output of pseudo random number generator. Should be unsigned number.
VType of output of parameter generator.

Constructor & Destructor Documentation

template<typename U , typename V = U>
MTToolBox::AlgorithmRecursionAndTempering< U, V >::AlgorithmRecursionAndTempering ( AbstractGenerator< V > &  bg,
const AlgorithmPrimitivity primitivity = MersennePrimitivity 
)
inline

Constructor.

Parameters
bga generator used for generating numbers to make parameters. This generator is not need to be GF(2)-linear pseudo random number generator, for example, TinyMTDC in sample directory uses sequential counter.
primitivityAn algorithm to check primitivity. As a default, MersennePrimitivity is selected.

Member Function Documentation

template<typename U , typename V = U>
const NTL::GF2X& MTToolBox::AlgorithmRecursionAndTempering< U, V >::getCharacteristicPolynomial ( )
inline

Returns characteristic polynomial of state transition function.

Returns
characteristic polynomial of state transition function.
template<typename U , typename V = U>
int MTToolBox::AlgorithmRecursionAndTempering< U, V >::getDelta ( )
inline

returns sum of d(v)s, which are difference between k(v) and theoretical upper bound.

Returns
sum of d(v)s.
template<typename U , typename V = U>
int MTToolBox::AlgorithmRecursionAndTempering< U, V >::getWeight ( )
inline

Returns Hamming weight of characteristic polynomial of state transition function.

Returns
Hamming weight of characteristic polynomial.
template<typename U , typename V = U>
bool MTToolBox::AlgorithmRecursionAndTempering< U, V >::search ( TemperingCalculatable< U, V > &  lg,
AlgorithmTempering< U, V > &  st1,
AlgorithmTempering< U, V > &  st2,
bool  verbose = false,
std::ostream &  os = std::cout,
bool  no_lsb = false 
)
inline

Search parameters for state transition function and parameters for tempering.

Parameters
lgGF(2)-linear pseudo random number generator whose parameters are to be searched.
st1Algorithm for searching tempering parameters.
st2Algorithm for searching tempering parameters from LSB.
verboseif true redundant messages will be outputed.
osoutput stream for redundant messages.
no_lsbif true, st2 will not be used.
Returns
false if no tempering parameters which gives proper state transition function are found.

References MTToolBox::AbstractGenerator< U >::bitSize(), MTToolBox::AlgorithmEquidistribution< U, V >::get_all_equidist(), MTToolBox::RecursionSearchable< U, V >::getParamString(), MTToolBox::AlgorithmTempering< U, V >::isLSBTempering(), MTToolBox::isPrime(), MTToolBox::TemperingCalculatable< U, V >::resetReverseOutput(), and MTToolBox::TemperingCalculatable< U, V >::setReverseOutput().

Referenced by MTToolBox::AlgorithmRecursionAndTempering< U, V >::search().

template<typename U , typename V = U>
bool MTToolBox::AlgorithmRecursionAndTempering< U, V >::search ( TemperingCalculatable< U, V > &  lg,
AlgorithmTempering< U, V > &  st,
bool  verbose = false,
std::ostream &  os = std::cout 
)
inline

Simple wrapper for users who want to search tempering parameter only from MSB.

Parameters for state transition function are searched.

Parameters
lgGF(2)-linear pseudo random number generator whose parameters are to be searched.
stAlgorithm for searching tempering parameters.
verboseif true redundant messages will be outputed.
osoutput stream for redundant messages.
Returns
false if no tempering parameters which gives proper state transition function are found.

References MTToolBox::AlgorithmRecursionAndTempering< U, V >::search().


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