Tomographer
v5.2
Tomographer C++ Framework Documentation
|
Data needed to be accessible to the working code. More...
#include <tomographer/mhrwtasks.h>
Public Types | |
typedef IterCountIntType_ | IterCountIntType |
Type used to count the number of iterations. | |
typedef MHWalkerParams_ | MHWalkerParams |
Type used to specify the step size. | |
typedef RngSeedType_ | RngSeedType |
Type used to specify the seed of the random number generator. More... | |
typedef MHRWParams< MHWalkerParams, IterCountIntType > | MHRWParamsType |
Type to store the parameters of the Metropolis-Hastings random walk (number of runs, sweep size, etc.) More... | |
Public Member Functions | |
template<typename MHRWParamsType > | |
CDataBase (MHRWParamsType &&p, RngSeedType base_seed_) | |
Constructor. More... | |
template<typename TaskNoCountIntType > | |
RngSeedType | getTaskInput (TaskNoCountIntType k) const |
Returns a random seed to seed the random number generator with for run number k. More... | |
void | printBasicCDataMHRWInfo (std::ostream &str) const |
Get some human-readable info about the random walk as a string. More... | |
std::string | getBasicCDataMHRWInfo () const |
Get some human-readable info about the random walk as a string, see printBasicCDataMHRWInfo() | |
Public Attributes | |
const MHRWParamsType | mhrw_params |
Parameters of the random walk. More... | |
const RngSeedType | base_seed |
A base random seed from which each run seed will be derived. More... | |
Data needed to be accessible to the working code.
This is only a base class for the actual CData. The actual CData must additionally provide some methods, e.g. to create the random walk and stats collectors. See MHRandomWalkTaskCData Interface.
Stores the parameters to the random walk.
Definition at line 133 of file mhrwtasks.h.
typedef MHRWParams<MHWalkerParams, IterCountIntType> Tomographer::MHRWTasks::CDataBase< MHWalkerParams_, IterCountIntType_, RngSeedType_ >::MHRWParamsType |
Type to store the parameters of the Metropolis-Hastings random walk (number of runs, sweep size, etc.)
See MHRWParams<MHWalkerParams,IterCountIntType>
Definition at line 151 of file mhrwtasks.h.
typedef RngSeedType_ Tomographer::MHRWTasks::CDataBase< MHWalkerParams_, IterCountIntType_, RngSeedType_ >::RngSeedType |
Type used to specify the seed of the random number generator.
Definition at line 144 of file mhrwtasks.h.
|
inline |
Constructor.
Make sure to initialize base_seed to something quite random (e.g. current time in seconds) so that independent runs of your program won't produce the exact same results.
Definition at line 161 of file mhrwtasks.h.
|
inline |
Returns a random seed to seed the random number generator with for run number k.
This simply returns
This should be considered as the input of the k-th task. Each task must of course have a different seed, otherwise we will just repeat the same "random" walks!
Definition at line 202 of file mhrwtasks.h.
|
inline |
Get some human-readable info about the random walk as a string.
Definition at line 213 of file mhrwtasks.h.
const RngSeedType Tomographer::MHRWTasks::CDataBase< MHWalkerParams_, IterCountIntType_, RngSeedType_ >::base_seed |
A base random seed from which each run seed will be derived.
For each new random walk, a new pseudorandom number generator instance is created with a new seed.
In order to be able to reproduce results, the seeds are set deterministically from the base_seed, by using for the random seed of the k-th random walk: seed[k] = base_seed + k
Thus, by setting the base_seed to a fixed value you can reproduce all the results of a run. However, in order for your program not to output exactly the same thing if it is run a second time, and to make sure the points are indeed random, you must randomize base_seed, e.g. using the current time.
Definition at line 190 of file mhrwtasks.h.
const MHRWParamsType Tomographer::MHRWTasks::CDataBase< MHWalkerParams_, IterCountIntType_, RngSeedType_ >::mhrw_params |
Parameters of the random walk.
Stores the number of iterations per sweep, the number of thermalizing sweeps, the number of "live" sweeps, and the step size of the random walk.
See MHRWParams<MHWalkerParams,IterCountIntType>
Definition at line 174 of file mhrwtasks.h.