Tomographer  v1.0a
Tomographer C++ Framework Documentation
Tomographer::MHRWTasks::CDataBase< CountIntType_, RealType_ > Struct Template Reference

Data needed to be accessible to the working code. More...

#include <tomographer/mhrwtasks.h>

Public Types

typedef CountIntType_ CountIntType
 Type used to count the number of iterations.
 
typedef RealType_ RealType
 Type used to specify the step size.
 

Public Member Functions

 CDataBase (int base_seed_=0)
 Constructor. More...
 

Public Attributes

CountIntType n_sweep
 Parameter of the random walk – number of iterations per sweep.
 
CountIntType n_therm
 Parameter of the random walk – number of thermalizing sweeps.
 
CountIntType n_run
 Parameter of the random walk – number of "live" sweeps.
 
RealType step_size
 Parameter of the random walk – step size of the random walk.
 
int base_seed
 A base random seed from which each run seed will be derived. More...
 

Detailed Description

template<typename CountIntType_ = unsigned int, typename RealType_ = double>
struct Tomographer::MHRWTasks::CDataBase< CountIntType_, RealType_ >

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 68 of file mhrwtasks.h.

Constructor & Destructor Documentation

template<typename CountIntType_ = unsigned int, typename RealType_ = double>
Tomographer::MHRWTasks::CDataBase< CountIntType_, RealType_ >::CDataBase ( int  base_seed_ = 0)
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 76 of file mhrwtasks.h.

Member Data Documentation

template<typename CountIntType_ = unsigned int, typename RealType_ = double>
int Tomographer::MHRWTasks::CDataBase< CountIntType_, RealType_ >::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 109 of file mhrwtasks.h.


The documentation for this struct was generated from the following file: