MTToolBox  0.2.10
Public Member Functions
MTToolBox::AlgorithmPartialBitPattern< U, V, bit_len, param_num, try_bit_len, step, lsb > Class Template Reference

Algorithm that search tempering parameters to improve dimension of equi-distribution of output of pseudo random number generator. More...

#include <AlgorithmPartialBitPattern.hpp>

Inheritance diagram for MTToolBox::AlgorithmPartialBitPattern< U, V, bit_len, param_num, try_bit_len, step, lsb >:
MTToolBox::AlgorithmTempering< U, V >

Public Member Functions

int operator() (TemperingCalculatable< U, V > &rand, bool verbose=false)
 Search tempering parameters. More...
 
bool isLSBTempering () const
 Shows if searching tempering parameters is from LSBs. More...
 
- Public Member Functions inherited from MTToolBox::AlgorithmTempering< U, V >
virtual ~AlgorithmTempering ()
 Virtual destructor (always required) More...
 

Detailed Description

template<typename U, typename V, int bit_len, int param_num, int try_bit_len, int step = 5, bool lsb = false>
class MTToolBox::AlgorithmPartialBitPattern< U, V, bit_len, param_num, try_bit_len, step, lsb >

Algorithm that search tempering parameters to improve dimension of equi-distribution of output of pseudo random number generator.

This algorithm was developed when we design Mersenne Twister for Graphic Processors (MTGP). This algorithm also is used in Tiny Mersenne Twister (TinyMT).

Warning
If you could not get high dimension of equi-distribution after tempering using parameters got by this algorithm, you should consider changing the design of random number generation algorithm.
Template Parameters
Utype of output of pseudo random number generator, for example, uint32_t. Only unsigned numbers are allowed.
Vtype of output of parameter generator.
bit_lenbit length of variable for tempering parameter
param_numnumber of tempering parameters, for instance, four for MTGP and one for TinyMT.
try_bit_lenlength of tempering part of output.
stepspecify how many bits are generated as bit pattern. If large number is specified, it will consume huge CPU time. For example, five is specified in MTGP parameter search.
lsbWhen lsb is true, meaning of MSBs and LSBs are changed. This program calculate equi-distribution from LSB not MSB.

Member Function Documentation

template<typename U , typename V , int bit_len, int param_num, int try_bit_len, int step = 5, bool lsb = false>
bool MTToolBox::AlgorithmPartialBitPattern< U, V, bit_len, param_num, try_bit_len, step, lsb >::isLSBTempering ( ) const
inlinevirtual

Shows if searching tempering parameters is from LSBs.

Returns
true if searching is from LSBs.

Reimplemented from MTToolBox::AlgorithmTempering< U, V >.

template<typename U , typename V , int bit_len, int param_num, int try_bit_len, int step = 5, bool lsb = false>
int MTToolBox::AlgorithmPartialBitPattern< U, V, bit_len, param_num, try_bit_len, step, lsb >::operator() ( TemperingCalculatable< U, V > &  rand,
bool  verbose = false 
)
inlinevirtual

Search tempering parameters.

Searched parameters are set to rand. This process may consume large CPU time.

Parameters
randpseudo random number generator
verboseif true output redundant messages.
Returns
always zero.

Implements MTToolBox::AlgorithmTempering< U, V >.

References MTToolBox::TemperingCalculatable< U, V >::resetReverseOutput(), and MTToolBox::TemperingCalculatable< U, V >::setReverseOutput().


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