Template Class CMonteCarlo

Nested Relationships

Nested Types

Class Documentation

template<typename T, typename NUM, typename OTHER>
class CMonteCarlo

Montecarlo simulation for experiments in 1D. Template arguments are:

  • T: base type, i.e., if an experiment needs to generate random points, then T may be a TPoint3D, and so on.

  • NUM: the numeric type used to represent the error. Usually, double.

  • OTHER: an intermediate type, used especially when testing inverse functions. Leave as int or double if you don’t use it.

HOW TO USE THIS CLASS:

  • Create an instance of the class.

  • Refill the “valueGenerator” member with an appropriate function.

  • If your experiment calculates the error directly from the base value, then refill the “errorFun1” member.

  • Otherwise, if your experiment involves the calculation of some value whom with the experimental function is compared, refill “intermediateFun” and “errorFun2”.

  • Refill only on of the alternatives.

Public Functions

inline CMonteCarlo()
inline NUM doExperiment(size_t N, double &time, bool showInWindow = false)

Public Members

T (*valueGenerator)(mrpt::random::CRandomGenerator&)
NUM (*errorFun1)(const T&)
OTHER (*intermediateFun)(const T&)
NUM (*errorFun2)(const T&, const OTHER&)