MTToolBox  0.2.10
Public Types | Public Member Functions | Data Fields
MTToolBox::linear_generator_vector< U, V > Class Template Reference

GF(2) pseudo random number generator as a GF(2) vector. More...

#include <AlgorithmEquidistribution.hpp>

Public Types

typedef EquidistributionCalculatable< U, V > ECGenerator
 pseudo random number generator which can calculate dimension of equi-distribution. More...
 

Public Member Functions

 linear_generator_vector (const ECGenerator &generator)
 Constructor. More...
 
 linear_generator_vector (const ECGenerator &generator, int bit_pos)
 Constructor for standard basis. More...
 
void add (const linear_generator_vector< U, V > &src)
 Vector addition. More...
 
void next_state (int bit_len)
 State transition of pseudo random number generator. More...
 
void debug_print ()
 

Data Fields

shared_ptr< ECGeneratorrand
 A GF(2) linear pseudo random number generator. More...
 
int count
 number which shows counts of next_state() called. More...
 
bool zero
 Shows if zero vector or not. More...
 
next
 latest output of pseudo random number generator, or, a GF(2) vector consists of coefficients of highest degree term of polynomial. More...
 

Detailed Description

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

GF(2) pseudo random number generator as a GF(2) vector.

This class treats a GF(2) pseudo random number generator as a GF(2) vector. And also the class treats the generator as a vector of polynomials over GF(2).

Template Parameters
Utype of output of pseudo random number generator. Should be unsigned type.
Vtype of output of parameter generator.

Member Typedef Documentation

template<typename U, typename V = U>
typedef EquidistributionCalculatable<U, V> MTToolBox::linear_generator_vector< U, V >::ECGenerator

pseudo random number generator which can calculate dimension of equi-distribution.

Constructor & Destructor Documentation

template<typename U, typename V = U>
MTToolBox::linear_generator_vector< U, V >::linear_generator_vector ( const ECGenerator generator)
inline

Constructor.

Parameters
generatorGF(2) pseudo random number generator, whose dimension of equi-distribution will be calculated.

References MTToolBox::linear_generator_vector< U, V >::count, MTToolBox::linear_generator_vector< U, V >::next, MTToolBox::linear_generator_vector< U, V >::rand, MTToolBox::setZero(), and MTToolBox::linear_generator_vector< U, V >::zero.

template<typename U, typename V = U>
MTToolBox::linear_generator_vector< U, V >::linear_generator_vector ( const ECGenerator generator,
int  bit_pos 
)
inline

Constructor for standard basis.

Construct a vector which consists standard basis. As a generator, this generates a number include only one bit once, and then generate zero forever. For instance, it generates 1, 0, 0, 0, ... or 8, 0, 0, 0, ...

References MTToolBox::linear_generator_vector< U, V >::count, MTToolBox::linear_generator_vector< U, V >::next, MTToolBox::linear_generator_vector< U, V >::rand, and MTToolBox::linear_generator_vector< U, V >::zero.

Member Function Documentation

template<typename U , typename V >
void MTToolBox::linear_generator_vector< U, V >::add ( const linear_generator_vector< U, V > &  src)

Vector addition.

Parameters
srcsource vector to be added to this vector

References MTToolBox::linear_generator_vector< U, V >::next, and MTToolBox::linear_generator_vector< U, V >::rand.

template<typename U , typename V >
void MTToolBox::linear_generator_vector< U, V >::debug_print ( )
template<typename U , typename V >
void MTToolBox::linear_generator_vector< U, V >::next_state ( int  bit_len)

State transition of pseudo random number generator.

As a vector of polynomial, multiply by an indeterminate.

Parameters
bit_lenbit length from MSB, or v of k(v) currently calculating.

References MTToolBox::isZero().

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

Field Documentation

template<typename U, typename V = U>
int MTToolBox::linear_generator_vector< U, V >::count

number which shows counts of next_state() called.

As a polynomial, this is related to degree of polynomial.

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

template<typename U, typename V = U>
U MTToolBox::linear_generator_vector< U, V >::next

latest output of pseudo random number generator, or, a GF(2) vector consists of coefficients of highest degree term of polynomial.

Referenced by MTToolBox::linear_generator_vector< U, V >::add(), and MTToolBox::linear_generator_vector< U, V >::linear_generator_vector().

template<typename U, typename V = U>
shared_ptr<ECGenerator> MTToolBox::linear_generator_vector< U, V >::rand
template<typename U, typename V = U>
bool MTToolBox::linear_generator_vector< U, V >::zero

Shows if zero vector or not.

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


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