Graphitti
A toolkit/software architecture to ease creating high-performance neural network simulators
Loading...
Searching...
No Matches
MTRand Class Reference
Inheritance diagram for MTRand:

Public Member Functions

 MTRand (uint32_t oneSeed)
 
 MTRand (uint32_t *const bigSeed, uint32_t seedLength=N)
 
BGFLOAT rand ()
 
BGFLOAT rand (BGFLOAT n)
 
BGFLOAT randExc ()
 
BGFLOAT randExc (BGFLOAT n)
 
BGFLOAT randDblExc ()
 
BGFLOAT randDblExc (BGFLOAT n)
 
uint32_t randInt ()
 
uint32_t randInt (uint32_t n)
 
virtual BGFLOAT operator() ()
 
BGFLOAT inRange (BGFLOAT min, BGFLOAT max)
 
BGFLOAT rand53 ()
 
BGFLOAT randNorm (BGFLOAT mean=0.0, BGFLOAT variance=0.0)
 
virtual void seed (uint32_t oneSeed)
 
void seed (uint32_t *const bigSeed, uint32_t seedLength=N)
 
virtual void seed ()
 
void save (uint32_t *saveArray) const
 
void load (uint32_t *const loadArray)
 
template<class Archive >
void serialize (Archive &archive)
 Cereal serialization method.
 

Static Public Member Functions

static MTRandCreate ()
 

Static Public Attributes

static const int N = 624
 
static const int SAVE = N + 1
 

Protected Member Functions

void initialize (uint32_t oneSeed)
 
void reload ()
 
uint32_t hiBit (uint32_t u) const
 
uint32_t loBit (uint32_t u) const
 
uint32_t loBits (uint32_t u) const
 
uint32_t mixBits (uint32_t u, uint32_t v) const
 
uint32_t twist (uint32_t m, uint32_t s0, uint32_t s1) const
 

Static Protected Member Functions

static uint32_t hash (time_t t, clock_t c)
 

Protected Attributes

uint32_t state [N]
 
int iNext
 
int left
 

Static Protected Attributes

static const int M = 397
 

Friends

std::ostream & operator<< (std::ostream &os, const MTRand &mtrand)
 
std::istream & operator>> (std::istream &is, MTRand &mtrand)
 

Detailed Description

Definition at line 88 of file MTRand.h.

Constructor & Destructor Documentation

◆ MTRand() [1/3]

MTRand::MTRand ( uint32_t oneSeed)

Definition at line 71 of file MTRand.cpp.

◆ MTRand() [2/3]

MTRand::MTRand ( uint32_t *const bigSeed,
uint32_t seedLength = N )

Definition at line 76 of file MTRand.cpp.

◆ MTRand() [3/3]

MTRand::MTRand ( )

Definition at line 81 of file MTRand.cpp.

Member Function Documentation

◆ Create()

static MTRand * MTRand::Create ( )
inlinestatic

Creates an instance of the class.

Returns
Reference to the instance of the class.

Definition at line 97 of file MTRand.h.

◆ hash()

uint32_t MTRand::hash ( time_t t,
clock_t c )
staticprotected

Definition at line 328 of file MTRand.cpp.

◆ hiBit()

uint32_t MTRand::hiBit ( uint32_t u) const
protected

Definition at line 357 of file MTRand.cpp.

◆ initialize()

void MTRand::initialize ( uint32_t oneSeed)
protected

Definition at line 295 of file MTRand.cpp.

◆ inRange()

BGFLOAT MTRand::inRange ( BGFLOAT min,
BGFLOAT max )

Definition at line 152 of file MTRand.cpp.

◆ load()

void MTRand::load ( uint32_t *const loadArray)

Definition at line 262 of file MTRand.cpp.

◆ loBit()

uint32_t MTRand::loBit ( uint32_t u) const
protected

Definition at line 362 of file MTRand.cpp.

◆ loBits()

uint32_t MTRand::loBits ( uint32_t u) const
protected

Definition at line 367 of file MTRand.cpp.

◆ mixBits()

uint32_t MTRand::mixBits ( uint32_t u,
uint32_t v ) const
protected

Definition at line 372 of file MTRand.cpp.

◆ operator()()

BGFLOAT MTRand::operator() ( void )
virtual

Reimplemented in Norm.

Definition at line 352 of file MTRand.cpp.

◆ rand() [1/2]

BGFLOAT MTRand::rand ( )

Definition at line 86 of file MTRand.cpp.

◆ rand() [2/2]

BGFLOAT MTRand::rand ( BGFLOAT n)

Definition at line 91 of file MTRand.cpp.

◆ rand53()

BGFLOAT MTRand::rand53 ( )

Definition at line 161 of file MTRand.cpp.

◆ randDblExc() [1/2]

BGFLOAT MTRand::randDblExc ( )

Definition at line 106 of file MTRand.cpp.

◆ randDblExc() [2/2]

BGFLOAT MTRand::randDblExc ( BGFLOAT n)

Definition at line 111 of file MTRand.cpp.

◆ randExc() [1/2]

BGFLOAT MTRand::randExc ( )

Definition at line 96 of file MTRand.cpp.

◆ randExc() [2/2]

BGFLOAT MTRand::randExc ( BGFLOAT n)

Definition at line 101 of file MTRand.cpp.

◆ randInt() [1/2]

uint32_t MTRand::randInt ( )

Definition at line 116 of file MTRand.cpp.

◆ randInt() [2/2]

uint32_t MTRand::randInt ( uint32_t n)

Definition at line 133 of file MTRand.cpp.

◆ randNorm()

BGFLOAT MTRand::randNorm ( BGFLOAT mean = 0.0,
BGFLOAT variance = 0.0 )

Definition at line 167 of file MTRand.cpp.

◆ reload()

void MTRand::reload ( )
protected

Definition at line 312 of file MTRand.cpp.

◆ save()

void MTRand::save ( uint32_t * saveArray) const

Definition at line 251 of file MTRand.cpp.

◆ seed() [1/3]

void MTRand::seed ( )
virtual

Definition at line 225 of file MTRand.cpp.

◆ seed() [2/3]

void MTRand::seed ( uint32_t *const bigSeed,
uint32_t seedLength = N )

Definition at line 185 of file MTRand.cpp.

◆ seed() [3/3]

void MTRand::seed ( uint32_t oneSeed)
virtual

Definition at line 177 of file MTRand.cpp.

◆ serialize()

template<class Archive >
void MTRand::serialize ( Archive & archive)

Cereal serialization method.

Definition at line 171 of file MTRand.h.

◆ twist()

uint32_t MTRand::twist ( uint32_t m,
uint32_t s0,
uint32_t s1 ) const
protected

Definition at line 377 of file MTRand.cpp.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const MTRand & mtrand )
friend

Definition at line 274 of file MTRand.cpp.

◆ operator>>

std::istream & operator>> ( std::istream & is,
MTRand & mtrand )
friend

Definition at line 284 of file MTRand.cpp.

Member Data Documentation

◆ iNext

int MTRand::iNext
protected

Definition at line 106 of file MTRand.h.

◆ left

int MTRand::left
protected

Definition at line 107 of file MTRand.h.

◆ M

const int MTRand::M = 397
staticprotected

Definition at line 103 of file MTRand.h.

◆ N

const int MTRand::N = 624
static

Definition at line 91 of file MTRand.h.

◆ SAVE

const int MTRand::SAVE = N + 1
static

Definition at line 92 of file MTRand.h.

◆ state

uint32_t MTRand::state[N]
protected

Definition at line 105 of file MTRand.h.


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