SUNphi  1.0
SUNphi::SFMTRandomGen Class Reference

SIMD Fast Mersenne Twister. More...

#include <SFMT.hpp>

Classes

union  w128_t
 128-bit data structure More...
 

Public Member Functions

void periodCertification ()
 Certificate the period of 2^MEXP. More...
 
void randomizeAll ()
 Generates a new state.
 
uint32_t operator() ()
 Gets the next random number in the stream. More...
 
void seed (const uint32_t &seed)
 Seed the state with a 32-bit integer seed.
 

Private Types

enum  LEFT_RIGHT_T { LEFT, RIGHT }
 Used to shift left or right.
 

Private Member Functions

template<LEFT_RIGHT_T LeftRight>
w128_t shift128 (const w128_t &in, const int &shift)
 Emulates the SIMD implementation.
 
void recursion (w128_t &r, w128_t &a, w128_t &b, w128_t &c, w128_t &d)
 Performs the recursion.
 

Private Attributes

w128_t state [N]
 State array.
 
int idx
 Counter to the 32-bit internal state array.
 

Static Private Attributes

static constexpr int MEXP
 Exponent of the period. More...
 
static constexpr int N
 Number of 128-bit words. More...
 
static constexpr int N32
 Number of 32-bit words. More...
 

Detailed Description

SIMD Fast Mersenne Twister.

Definition at line 56 of file SFMT.hpp.

Member Function Documentation

uint32_t SUNphi::SFMTRandomGen::operator() ( )
inline

Gets the next random number in the stream.

Proxy to he first element of the state

Definition at line 270 of file SFMT.hpp.

void SUNphi::SFMTRandomGen::periodCertification ( )
inline

Certificate the period of 2^MEXP.

Check

Definition at line 187 of file SFMT.hpp.

Member Data Documentation

constexpr int SUNphi::SFMTRandomGen::MEXP
staticprivate
Initial value:
=
19937

Exponent of the period.

Definition at line 113 of file SFMT.hpp.

constexpr int SUNphi::SFMTRandomGen::N
staticprivate
Initial value:
=
MEXP/128+1

Number of 128-bit words.

Definition at line 117 of file SFMT.hpp.

constexpr int SUNphi::SFMTRandomGen::N32
staticprivate
Initial value:
=
N*4

Number of 32-bit words.

Definition at line 121 of file SFMT.hpp.


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