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

Base class of random number generators. More...

#include <randomNumbers.h>

Inheritance diagram for RandomNumbers:
RandomNumbers_Mseries RandomNumbers_MT19937

Classes

class  rand_gauss_even
 
class  rand_gauss_odd
 
class  rand_uniform
 

Public Member Functions

 RandomNumbers ()
 
virtual ~RandomNumbers ()
 
void set_parameter_verboselevel (const Bridge::VerboseLevel vl)
 
virtual double get ()=0
 
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...
 
virtual void read_file (const std::string &)=0
 save and load random number status. More...
 
virtual void write_file (const std::string &)=0
 
virtual void reset (unsigned long seed)=0
 reset state with new seed. More...
 

Static Public Attributes

static const std::string class_name = "RandomNumbers"
 

Protected Attributes

Bridge::VerboseLevel m_vl
 

Private Member Functions

 RandomNumbers (const RandomNumbers &)
 
RandomNumbersoperator= (const RandomNumbers &)
 
template<typename InnerGenerator >
void generate_global (Field &f)
 

Detailed Description

Base class of random number generators.

This class defines the interface of random number generator, and implements common methods. Practical methods to generate random numbers are defined in subclasses. This class also implements Gaussian random number and method to set a global field of Gaussian random numbers and cut it out to the local field for the own node (gauss_lex_global()) which is useful in HMC etc. [25 Dec 2011 H.Matsufuru] U1,Z2 are added [11 Jan 2017 Y.Namekawa] Factory is introduced [ 2 Feb 2017 Y.Namekawa]

Definition at line 43 of file randomNumbers.h.

Constructor & Destructor Documentation

RandomNumbers::RandomNumbers ( )
inline

Definition at line 53 of file randomNumbers.h.

virtual RandomNumbers::~RandomNumbers ( )
inlinevirtual

Definition at line 56 of file randomNumbers.h.

RandomNumbers::RandomNumbers ( const RandomNumbers )
private

Member Function Documentation

void RandomNumbers::gauss ( double &  rand1,
double &  rand2 
)

Definition at line 62 of file randomNumbers.cpp.

void RandomNumbers::gauss_eo_global ( Field f)
virtual

gaussian noise for even-odd perconditioned field (S.UEDA)

Definition at line 169 of file randomNumbers.cpp.

void RandomNumbers::gauss_lex_global ( Field f)
virtual

gaussian random number defined on global lattice.

Definition at line 95 of file randomNumbers.cpp.

template<typename InnerGenerator >
void RandomNumbers::generate_global ( Field f)
private

Definition at line 275 of file randomNumbers.cpp.

virtual double RandomNumbers::get ( )
pure virtual
void RandomNumbers::lex_global ( const std::string &  str_rand_type,
Field f 
)
virtual

Definition at line 77 of file randomNumbers.cpp.

RandomNumbers& RandomNumbers::operator= ( const RandomNumbers )
private
virtual void RandomNumbers::read_file ( const std::string &  )
pure virtual

save and load random number status.

Implemented in RandomNumbers_Mseries, and RandomNumbers_MT19937.

virtual void RandomNumbers::reset ( unsigned long  seed)
pure virtual

reset state with new seed.

Implemented in RandomNumbers_Mseries, and RandomNumbers_MT19937.

void RandomNumbers::set_parameter_verboselevel ( const Bridge::VerboseLevel  vl)
inline

Definition at line 64 of file randomNumbers.h.

void RandomNumbers::U1_lex_global ( Field f)
virtual

U(1) random number defined on global lattice.

Definition at line 113 of file randomNumbers.cpp.

void RandomNumbers::uniform_lex_global ( Field f)
virtual

uniform random number defined on global lattice.

Definition at line 106 of file randomNumbers.cpp.

virtual void RandomNumbers::write_file ( const std::string &  )
pure virtual
void RandomNumbers::Z2_lex_global ( Field f)
virtual

Z(2) random number defined on global lattice.

Definition at line 142 of file randomNumbers.cpp.

Member Data Documentation

const std::string RandomNumbers::class_name = "RandomNumbers"
static

Definition at line 46 of file randomNumbers.h.

Bridge::VerboseLevel RandomNumbers::m_vl
protected

Definition at line 49 of file randomNumbers.h.


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