Bridge++  Ver. 2.0.2
randomNumberManager.h
Go to the documentation of this file.
1 
14 #ifndef RANDOMNUMBER_MANAGER_INCLUDED
15 #define RANDOMNUMBER_MANAGER_INCLUDED
16 
17 #include "randomNumbers.h"
18 
19 #include "IO/bridgeIO.h"
20 using Bridge::vout;
21 
23 
54 {
55  public:
56  static const std::string class_name;
57 
58  protected:
60 
61  public:
62 
64  : m_vl(CommonParameters::Vlevel()) {}
65 
66  virtual ~RandomNumberManager() {}
67 
68  // class methods
69  static RandomNumbers *getInstance();
70 
71  static bool initialize(const std::string& rng_type, unsigned long seed);
72  static void finalize();
73 
74  static void reset(unsigned long seed);
75 
76  static void restore_state(const std::string& filename);
77  static void save_state(const std::string& filename);
78 
79  // factory
80  static RandomNumbers *New(const std::string& rng_type, unsigned long seed);
81 
82  private:
83  // non-copyable
86 
87  public:
89 
90  private:
92 
93  static RandomNumbers *factory(const std::string& rng_type, unsigned long seed);
94 };
95 #endif
bridgeIO.h
CommonParameters
Common parameter class: provides parameters as singleton.
Definition: commonParameters.h:42
randomNumbers.h
RandomNumbers
Base class of random number generators.
Definition: randomNumbers.h:43
RandomNumberManager::save_state
static void save_state(const std::string &filename)
Definition: randomNumberManager.cpp:116
RandomNumberManager::finalize
static void finalize()
Definition: randomNumberManager.cpp:80
RandomNumberManager::operator=
RandomNumberManager & operator=(const RandomNumberManager &)
RandomNumberManager::initialize
static bool initialize(const std::string &rng_type, unsigned long seed)
Definition: randomNumberManager.cpp:57
RandomNumberManager::set_parameter_verboselevel
void set_parameter_verboselevel(const Bridge::VerboseLevel vl)
Definition: randomNumberManager.h:88
RandomNumberManager
Manager class for RandomNumbers.
Definition: randomNumberManager.h:53
RandomNumberManager::New
static RandomNumbers * New(const std::string &rng_type, unsigned long seed)
Definition: randomNumberManager.cpp:129
ParameterCheck::vl
Bridge::VerboseLevel vl
Definition: parameterCheck.cpp:18
RandomNumberManager::reset
static void reset(unsigned long seed)
Definition: randomNumberManager.cpp:90
RandomNumberManager::m_vl
Bridge::VerboseLevel m_vl
Definition: randomNumberManager.h:59
RandomNumberManager::class_name
static const std::string class_name
Definition: randomNumberManager.h:56
RandomNumberManager::getInstance
static RandomNumbers * getInstance()
Definition: randomNumberManager.cpp:45
RandomNumberManager::factory
static RandomNumbers * factory(const std::string &rng_type, unsigned long seed)
Definition: randomNumberManager.cpp:26
RandomNumberManager::RandomNumberManager
RandomNumberManager()
Definition: randomNumberManager.h:63
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
RandomNumberManager::~RandomNumberManager
virtual ~RandomNumberManager()
Definition: randomNumberManager.h:66
RandomNumberManager::s_rand
static RandomNumbers * s_rand
Definition: randomNumberManager.h:91
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512
RandomNumberManager::restore_state
static void restore_state(const std::string &filename)
Definition: randomNumberManager.cpp:103