Tomographer
v4.0
Tomographer C++ Framework Documentation
|
Constant data structure for MH random walk tasks with a value histogram stats collector. More...
#include <tomographer/mhrw_valuehist_tasks.h>
Classes | |
struct | ResultsCollectorType |
Helper to get the results collector type. More... | |
Public Types | |
typedef MHRWTasks::CDataBase< IterCountIntType_, StepRealType_ > | Base |
The MHRWTasks::CDataBase base class. | |
typedef Base::IterCountIntType | IterCountIntType |
The integer type which serves to count the number of iterations (see MHRWParams) | |
typedef Base::StepRealType | StepRealType |
The real type which serves to describe the step size of the random walk (typically double ) | |
typedef HistCountIntType_ | HistCountIntType |
The integer counting type in our underlying raw histogram type. | |
typedef ValueCalculator_ | ValueCalculator |
The class which calculates the value we are collecting a histogram of (ValueCalculator Interface compliant) | |
typedef CountRealType_ | CountRealType |
The real type which serves to average histogram counts (typically double ) | |
typedef tomo_internal::histogram_types< CDataBase, UseBinningAnalysis >::MHRWStatsCollectorResultType | MHRWStatsCollectorResultType |
The result type of our stats collector. More... | |
typedef tomo_internal::histogram_types< CDataBase, UseBinningAnalysis >::HistogramType | HistogramType |
The histogram type reported by the task. More... | |
typedef tomo_internal::histogram_types< CDataBase, UseBinningAnalysis >::HistogramParams | HistogramParams |
The appropriate parameters type for the histogram reported by the task. | |
typedef MHRWParams< IterCountIntType, StepRealType > | MHRWParamsType |
Type for the parameters of the random walk. | |
Public Types inherited from Tomographer::MHRWTasks::CDataBase< IterCountIntType_, StepRealType_ > | |
typedef IterCountIntType_ | IterCountIntType |
Type used to count the number of iterations. | |
typedef StepRealType_ | StepRealType |
Type used to specify the step size. | |
typedef MHRWParams< IterCountIntType, StepRealType > | MHRWParamsType |
Type to store the parameters of the Metropolis-Hastings random walk (number of runs, sweep size, etc.) More... | |
Public Member Functions | |
template<ENABLED_IF( !UseBinningAnalysis) > | |
CDataBase (const ValueCalculator &valcalc_, HistogramParams histogram_params_, MHRWParamsType p, int base_seed=0) | |
Constructor (only for without binning analysis) | |
template<ENABLED_IF( UseBinningAnalysis) > | |
CDataBase (const ValueCalculator &valcalc_, HistogramParams histogram_params_, int binning_num_levels_, MHRWParamsType p, int base_seed=0) | |
Constructor (only for with binning analysis) | |
template<typename LoggerType , ENABLED_IF( !UseBinningAnalysis) > | |
ValueHistogramMHRWStatsCollector< ValueCalculator, LoggerType, HistogramType > | createStatsCollector (LoggerType &logger) const |
Create the stats collector (without binning analysis) More... | |
template<typename LoggerType , ENABLED_IF( UseBinningAnalysis) > | |
ValueHistogramWithBinningMHRWStatsCollector< typename tomo_internal::histogram_types< CDataBase, true >::BinningMHRWStatsCollectorParams, LoggerType > | createStatsCollector (LoggerType &logger) const |
Create the stats collector (with binning analysis) More... | |
Public Member Functions inherited from Tomographer::MHRWTasks::CDataBase< IterCountIntType_, StepRealType_ > | |
template<typename MHRWParamsType > | |
CDataBase (MHRWParamsType &&p, int base_seed_=0) | |
Constructor. More... | |
int | getTaskInput (int 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. | |
std::string | getBasicCDataMHRWInfo () const |
Get some human-readable info about the random walk as a string, see printBasicCDataMHRWInfo() | |
Public Attributes | |
const ValueCalculator | valcalc |
The value calculator instance. | |
const HistogramParams | histogram_params |
The parameters of the histogram that we are collecting. | |
const Tools::StoreIfEnabled< int, UseBinningAnalysis > | binningNumLevels |
The number of levels in the binning analysis (only if we are using a binning analysis) | |
Public Attributes inherited from Tomographer::MHRWTasks::CDataBase< IterCountIntType_, StepRealType_ > | |
const MHRWParamsType | mhrw_params |
Parameters of the random walk. More... | |
const int | base_seed |
A base random seed from which each run seed will be derived. More... | |
Static Public Attributes | |
static constexpr bool | UseBinningAnalysis = UseBinningAnalysis_ |
Whether or not we are to use a binning analysis for calculating the error bars. | |
Constant data structure for MH random walk tasks with a value histogram stats collector.
You should define your TaskCData class to inherit this class, and be compliant with the MHRandomWalkTaskCData Interface. This class already inherits MHRWTasks::CDataBase, so you only have to inherit this class and provide a createMHWalker() method (see MHRandomWalkTaskCData Interface). (Note that your class will automatically be compliant with the TaskCData Interface in this way.)
Look at the file test/minimal_tomorun.cxx
for an example of you to define your cdata class.
This class should be used in conjunction with a ResultsCollectorSimple or ResultsCollectorWithBinningAnalysis. For convenience, you can query the member ResultsCollectorType to get the correct results collector type according to whether we are using a binning analysis and with the correct parameters type.
We provide some useful typedefs, as well as the createStatsCollector() required by the MHRandomWalkTaskCData Interface.
ValueCalculator | the value calculator type you wish to use; defining which value you are interested in collecting a histogram of during the random walk; |
UseBinningAnalysis | whether or not to use a binning analysis to obtain reliable error bars during the random walk. |
IterCountIntType | the integer type to use for counting iterations. |
StepRealType | the real type to use for representing a step size in the random walk. |
CountRealType | the real type to use when calculating the scaled histogram with error bars. |
HistCountIntType | the integer type to record the histogram counts in the underlying raw histogram. |
Note: if your subclass also takes a template parameter to allow or not the use of a binning analysis, then you'll have to define two conditionally enabled constructors to cover both cases. For instance (see also the code in tomorun/tomorun_dispatch.h
for another example):
Definition at line 941 of file mhrw_valuehist_tasks.h.
typedef tomo_internal::histogram_types<CDataBase,UseBinningAnalysis>::HistogramType Tomographer::MHRWTasks::ValueHistogramTasks::CDataBase< ValueCalculator_, UseBinningAnalysis_, IterCountIntType_, StepRealType_, CountRealType_, HistCountIntType_ >::HistogramType |
The histogram type reported by the task.
Depending on whether we are using a binning analysis, this histogram type will have error bars.
It is either:
Definition at line 990 of file mhrw_valuehist_tasks.h.
typedef tomo_internal::histogram_types<CDataBase,UseBinningAnalysis>::MHRWStatsCollectorResultType Tomographer::MHRWTasks::ValueHistogramTasks::CDataBase< ValueCalculator_, UseBinningAnalysis_, IterCountIntType_, StepRealType_, CountRealType_, HistCountIntType_ >::MHRWStatsCollectorResultType |
The result type of our stats collector.
This is either:
Definition at line 975 of file mhrw_valuehist_tasks.h.
|
inline |
Create the stats collector (without binning analysis)
This method is provided in compliance with the MHRandomWalkTaskCData Interface for MHRandomWalkTask.
Definition at line 1033 of file mhrw_valuehist_tasks.h.
|
inline |
Create the stats collector (with binning analysis)
This method is provided in compliance with the MHRandomWalkTaskCData Interface for MHRandomWalkTask.
Definition at line 1051 of file mhrw_valuehist_tasks.h.