MTToolBox
0.2.10
|
Counting down number generator. More...
#include <Sequential.hpp>
Public Member Functions | |
Sequential () | |
Constructor. More... | |
Sequential (T p_mask) | |
Constructor with mask. More... | |
Sequential (T p_mask, T seed) | |
Sequential (Sequential< T > &src) | |
void | seed (T value) |
initialize internal state More... | |
void | reseed (T seed) |
T | generate () |
transit current internal state to next state and output a pseudo random number. More... | |
T | next () |
int | bitSize () const |
Return bit size of internal state, i.e dimension of GF(2)-vector space. More... | |
Public Member Functions inherited from MTToolBox::AbstractGenerator< T > | |
virtual | ~AbstractGenerator () |
Virtual destructor (always required) More... | |
Counting down number generator.
T | type of output, should be integer type |
|
inline |
Constructor.
|
inline |
Constructor with mask.
[in] | p_mask | p_mask and internal counter are exclusively or-ed when output time. |
|
inline |
References MTToolBox::Sequential< T >::seed().
|
inline |
|
inlinevirtual |
Return bit size of internal state, i.e dimension of GF(2)-vector space.
It will be Mersenne Exponent, when generator use incomplete array, like Mersenne Twister.
Implements MTToolBox::AbstractGenerator< T >.
|
inlinevirtual |
transit current internal state to next state and output a pseudo random number.
Implements MTToolBox::AbstractGenerator< T >.
References MTToolBox::Sequential< T >::next().
|
inline |
Referenced by MTToolBox::Sequential< T >::generate().
|
inline |
References MTToolBox::Sequential< T >::seed().
Referenced by MTToolBox::Sequential< T >::seed().
|
inlinevirtual |
initialize internal state
Initialization function does not need to be a GF(2)-linear function, non-GF(2)-linear function will be suitable. But as far as MTToolBox concerned, initialization only need to assure that the internal state is not zero. When generator use incomplete array, like Mersenne Twister, really used part of array should be set non-zero.
[in] | value | seed of initialization |
Implements MTToolBox::AbstractGenerator< T >.
References MTToolBox::Sequential< T >::reseed().
Referenced by MTToolBox::Sequential< T >::reseed(), and MTToolBox::Sequential< T >::Sequential().