Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RandomNumbers_MT19937 Class Reference

#include <randomNumbers_MT19937.h>

Inheritance diagram for RandomNumbers_MT19937:
RandomNumbers

Public Member Functions

 RandomNumbers_MT19937 (int s)
 
 RandomNumbers_MT19937 (unsigned long s)
 
 RandomNumbers_MT19937 (std::vector< unsigned long > &key)
 
 RandomNumbers_MT19937 (const std::string &filename)
 
 ~RandomNumbers_MT19937 ()
 
double get ()
 
void write_file (const std::string &)
 
void read_file (const std::string &)
 save and load random number status. More...
 
void reset (unsigned long seed)
 reset state with new seed. More...
 
- Public Member Functions inherited from RandomNumbers
 RandomNumbers ()
 
virtual ~RandomNumbers ()
 
void set_parameter_verboselevel (const Bridge::VerboseLevel vl)
 
void gauss (double &rand1, double &rand2)
 
virtual void lex_global (const std::string &, Field &)
 
virtual void gauss_lex_global (Field &)
 gaussian random number defined on global lattice. More...
 
virtual void uniform_lex_global (Field &)
 uniform random number defined on global lattice. More...
 
virtual void U1_lex_global (Field &)
 U(1) random number defined on global lattice. More...
 
virtual void Z2_lex_global (Field &)
 Z(2) random number defined on global lattice. More...
 
virtual void gauss_eo_global (Field &)
 gaussian noise for even-odd perconditioned field (S.UEDA) More...
 

Private Types

enum  { N =624, M =397 }
 

Private Member Functions

void init (unsigned long s)
 
void init (unsigned long s, std::vector< unsigned long > &key)
 
void nextState () const
 
unsigned long twist (unsigned long u, unsigned long v) const
 
unsigned long randInt32 () const
 
long randInt31 () const
 
double randDouble1 () const
 
double randDouble2 () const
 
double randDouble3 () const
 
double randRes53 () const
 

Private Attributes

int m_left
 
unsigned long m_state [N]
 
unsigned long * m_next
 

Static Private Attributes

static const std::string class_name = "RandomNumbers_MT19937"
 

Additional Inherited Members

- Static Public Attributes inherited from RandomNumbers
static const std::string class_name = "RandomNumbers"
 
- Protected Attributes inherited from RandomNumbers
Bridge::VerboseLevel m_vl
 

Detailed Description

Definition at line 43 of file randomNumbers_MT19937.h.

Member Enumeration Documentation

anonymous enum
private
Enumerator
N 
M 

Definition at line 88 of file randomNumbers_MT19937.h.

Constructor & Destructor Documentation

RandomNumbers_MT19937::RandomNumbers_MT19937 ( int  s)

Definition at line 27 of file randomNumbers_MT19937.cpp.

RandomNumbers_MT19937::RandomNumbers_MT19937 ( unsigned long  s)

Definition at line 39 of file randomNumbers_MT19937.cpp.

RandomNumbers_MT19937::RandomNumbers_MT19937 ( std::vector< unsigned long > &  key)
RandomNumbers_MT19937::RandomNumbers_MT19937 ( const std::string &  filename)
RandomNumbers_MT19937::~RandomNumbers_MT19937 ( )
inline

Definition at line 54 of file randomNumbers_MT19937.h.

Member Function Documentation

double RandomNumbers_MT19937::get ( )
inlinevirtual

Implements RandomNumbers.

Definition at line 56 of file randomNumbers_MT19937.h.

void RandomNumbers_MT19937::init ( unsigned long  s)
private

Definition at line 137 of file randomNumbers_MT19937.cpp.

void RandomNumbers_MT19937::init ( unsigned long  s,
std::vector< unsigned long > &  key 
)
private
void RandomNumbers_MT19937::nextState ( ) const
private

Definition at line 186 of file randomNumbers_MT19937.cpp.

double RandomNumbers_MT19937::randDouble1 ( ) const
private

Definition at line 242 of file randomNumbers_MT19937.cpp.

double RandomNumbers_MT19937::randDouble2 ( ) const
private

Definition at line 251 of file randomNumbers_MT19937.cpp.

double RandomNumbers_MT19937::randDouble3 ( ) const
private

Definition at line 260 of file randomNumbers_MT19937.cpp.

long RandomNumbers_MT19937::randInt31 ( ) const
private

Definition at line 234 of file randomNumbers_MT19937.cpp.

unsigned long RandomNumbers_MT19937::randInt32 ( ) const
private

Definition at line 219 of file randomNumbers_MT19937.cpp.

double RandomNumbers_MT19937::randRes53 ( ) const
private

Definition at line 269 of file randomNumbers_MT19937.cpp.

void RandomNumbers_MT19937::read_file ( const std::string &  )
virtual

save and load random number status.

Implements RandomNumbers.

Definition at line 67 of file randomNumbers_MT19937.cpp.

void RandomNumbers_MT19937::reset ( unsigned long  seed)
virtual

reset state with new seed.

Implements RandomNumbers.

Definition at line 130 of file randomNumbers_MT19937.cpp.

unsigned long RandomNumbers_MT19937::twist ( unsigned long  u,
unsigned long  v 
) const
private

Definition at line 204 of file randomNumbers_MT19937.cpp.

void RandomNumbers_MT19937::write_file ( const std::string &  )
virtual

Implements RandomNumbers.

Definition at line 106 of file randomNumbers_MT19937.cpp.

Member Data Documentation

const std::string RandomNumbers_MT19937::class_name = "RandomNumbers_MT19937"
staticprivate

Definition at line 45 of file randomNumbers_MT19937.h.

int RandomNumbers_MT19937::m_left
mutableprivate

Definition at line 90 of file randomNumbers_MT19937.h.

unsigned long* RandomNumbers_MT19937::m_next
mutableprivate

Definition at line 92 of file randomNumbers_MT19937.h.

unsigned long RandomNumbers_MT19937::m_state[N]
mutableprivate

Definition at line 91 of file randomNumbers_MT19937.h.


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