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

Search parameters of state transition function of pseudo random number generator so that the characteristic polynomial of the function will have max degree and will be primitive. More...

#include <AlgorithmReducibleRecursionSearch.hpp>

Public Member Functions

 AlgorithmReducibleRecursionSearch (ReducibleGenerator< U, V > &generator, AbstractGenerator< V > &bg)
 Constructor Size of internal state is supposed to be power of 2 and larger than Mersenne Exponent. More...
 
bool start (int try_count)
 Start searching recursion parameters. More...
 
const std::string getParamString ()
 Returns a string which shows parameters of pseudo random Call this method only after start() returns true. More...
 
const NTL::GF2X & getCharacteristicPolynomial ()
 Returns a minimal polynomial of output of the pseudo random number generator. More...
 
const NTL::GF2X & getIrreducibleFactor () const
 Returns a maxmum irreducible factor of minimal polynomial of output of the pseudo random number generator. More...
 
long getCount () const
 Returns tried count from the instance was created. More...
 

Detailed Description

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

Search parameters of state transition function of pseudo random number generator so that the characteristic polynomial of the function will have max degree and will be primitive.

Template Parameters
UType of output of pseudo random number generator. Should be unsigned number.
VType of output of base generator. Should be unsigned number.

Constructor & Destructor Documentation

template<typename U , typename V = U>
MTToolBox::AlgorithmReducibleRecursionSearch< U, V >::AlgorithmReducibleRecursionSearch ( ReducibleGenerator< U, V > &  generator,
AbstractGenerator< V > &  bg 
)
inline

Constructor Size of internal state is supposed to be power of 2 and larger than Mersenne Exponent.

Parameters
[in,out]generatorGF(2)-linear generator whose parameters will be searched. The generator will be changed.
[in,out]bga generator used for generating numbers to make parameters. This generator is not need to be GF(2)-linear pseudo random number generator.

Member Function Documentation

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

Returns a minimal polynomial of output of the pseudo random number generator.

Call this method only after start() returns true.

Returns
a minimal polynomial

This method may return a polynomial which may not be a characteristic polynomial.

template<typename U , typename V = U>
long MTToolBox::AlgorithmReducibleRecursionSearch< U, V >::getCount ( ) const
inline

Returns tried count from the instance was created.

Returns
tried count from the instance was created.
template<typename U , typename V = U>
const NTL::GF2X& MTToolBox::AlgorithmReducibleRecursionSearch< U, V >::getIrreducibleFactor ( ) const
inline

Returns a maxmum irreducible factor of minimal polynomial of output of the pseudo random number generator.

Call this method only after start() returns true.

Returns
a maxmun irreducible factor of minimal polynomial
template<typename U , typename V = U>
const std::string MTToolBox::AlgorithmReducibleRecursionSearch< U, V >::getParamString ( )
inline

Returns a string which shows parameters of pseudo random Call this method only after start() returns true.

Returns
String which shows parameters of pseudo random number generator.
template<typename U , typename V = U>
bool MTToolBox::AlgorithmReducibleRecursionSearch< U, V >::start ( int  try_count)
inline

Start searching recursion parameters.

  1. the generator make parameters randomly (RecursionSearchable.setUpParam()),
  2. calculate minimal polynomial of the generator,
  3. check if the polynomial has max possible degree and is primitive.
  4. if check OK, then return true.
  5. else repeat from 1.

If repeat count is over try_count, then return false.

Parameters
[in]try_countmaximum count of try
Returns
true when proper minimal polynomial is gotten.

References MTToolBox::hasFactorOfDegree(), and MTToolBox::minpoly().


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