Tomographer  v1.0a
Tomographer C++ Framework Documentation
Tomographer::MHRWTasks::MHRandomWalkTask< MHRandomWalkTaskCData, Rng > Struct Template Reference

Random Walk task, collecting statistics. More...

#include <tomographer/mhrwtasks.h>

Classes

struct  StatusReport
 Status Report for a MHRandomWalkTask. More...
 

Public Types

typedef MHRandomWalkTaskCData::CountIntType CountIntType
 
typedef MHRandomWalkTaskResult< typename MHRandomWalkTaskCData::MHRWStatsCollectorResultType, CountIntType > Result
 Result type of a single task run. More...
 
typedef StatusReport StatusReportType
 Typedef for StatusReport. This is needed by, e.g. MultiProc::OMP::TaskDispatcher.
 

Public Member Functions

template<typename LoggerType >
 MHRandomWalkTask (int inputseed, const MHRandomWalkTaskCData *, LoggerType &logger)
 Constructs the MHRandomWalkTask. More...
 
template<typename LoggerType , typename TaskManagerIface >
void run (const MHRandomWalkTaskCData *pcdata, LoggerType &logger, TaskManagerIface *tmgriface)
 Run this task. More...
 
const ResultgetResult () const
 

Static Public Member Functions

static int get_input (int k, const MHRandomWalkTaskCData *pcdata)
 Returns a random seed to seed the random number generator with for run number k. More...
 

Detailed Description

template<typename MHRandomWalkTaskCData, typename Rng = std::mt19937>
struct Tomographer::MHRWTasks::MHRandomWalkTask< MHRandomWalkTaskCData, Rng >

Random Walk task, collecting statistics.

This class can be used with MultiProc::OMP::TaskDispatcher, for example.

Template Parameters
MHRandomWalkTaskCDatamust comply with the MHRandomWalkTaskCData Interface and inherit from CDataBase<CountIntType,RealType> with appropriate types as required. The parameters to the random walk, as well as types to use, stats collector etc. are specified using this class.

Definition at line 161 of file mhrwtasks.h.

Member Typedef Documentation

template<typename MHRandomWalkTaskCData , typename Rng = std::mt19937>
typedef MHRandomWalkTaskResult<typename MHRandomWalkTaskCData::MHRWStatsCollectorResultType, CountIntType> Tomographer::MHRWTasks::MHRandomWalkTask< MHRandomWalkTaskCData, Rng >::Result

Result type of a single task run.

See MHRandomWalkTaskResult.

Definition at line 170 of file mhrwtasks.h.

Constructor & Destructor Documentation

template<typename MHRandomWalkTaskCData , typename Rng = std::mt19937>
template<typename LoggerType >
Tomographer::MHRWTasks::MHRandomWalkTask< MHRandomWalkTaskCData, Rng >::MHRandomWalkTask ( int  inputseed,
const MHRandomWalkTaskCData *  ,
LoggerType &  logger 
)
inline

Constructs the MHRandomWalkTask.

You should never need to call this directly, except if you're writing a task manager/dispatcher (e.g. OMPTaskDispatcher)

Definition at line 254 of file mhrwtasks.h.

Member Function Documentation

template<typename MHRandomWalkTaskCData , typename Rng = std::mt19937>
static int Tomographer::MHRWTasks::MHRandomWalkTask< MHRandomWalkTaskCData, Rng >::get_input ( int  k,
const MHRandomWalkTaskCData *  pcdata 
)
inlinestatic

Returns a random seed to seed the random number generator with for run number k.

This simply returns

pcdata->base_seed + k

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

template<typename MHRandomWalkTaskCData , typename Rng = std::mt19937>
template<typename LoggerType , typename TaskManagerIface >
void Tomographer::MHRWTasks::MHRandomWalkTask< MHRandomWalkTaskCData, Rng >::run ( const MHRandomWalkTaskCData *  pcdata,
LoggerType &  logger,
TaskManagerIface *  tmgriface 
)
inline

Run this task.

Runs this task, i.e. instantiates a MHRandomWalk with the provided inputs and data, and runs it.

This also takes care to call the task manager interface's status_report_requested() and submits a status report if required. See e.g. OMPTaskDispatcher::request_status_report().

Definition at line 278 of file mhrwtasks.h.


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