Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Math::IntegratorMultiDim Class Reference

User class for performing multidimensional integration.

By default uses adaptive multi-dimensional integration using the algorithm from Genz Mallik implemented in the class ROOT::Math::AdaptiveIntegratorMultiDim otherwise it can uses via the plug-in manager the MC integration class (ROOT::Math::GSLMCIntegration) from MathMore.

Definition at line 51 of file IntegratorMultiDim.h.

Public Types

typedef IntegrationMultiDim::Type Type
 

Public Member Functions

 IntegratorMultiDim (const IMultiGenFunction &f, IntegrationMultiDim::Type type=IntegrationMultiDim::kDEFAULT, double absTol=-1, double relTol=-1, unsigned int ncall=0)
 Generic Constructor of multi dimensional Integrator passing a function.
 
 IntegratorMultiDim (IntegrationMultiDim::Type type=IntegrationMultiDim::kDEFAULT, double absTol=-1, double relTol=-1, unsigned int ncall=0)
 Generic constructor of multi dimensional Integrator.
 
virtual ~IntegratorMultiDim ()
 Template Constructor of multi dimensional Integrator passing a generic function.
 
double Error () const
 return integration error
 
VirtualIntegratorMultiDimGetIntegrator ()
 return a pointer to integrator object
 
double Integral (const double *xmin, const double *xmax)
 evaluate the integral with the previously given function between xmin[] and xmax[]
 
double Integral (const IMultiGenFunction &f, const double *xmin, const double *xmax)
 evaluate the integral passing a new function
 
template<class Function >
double Integral (Function &f, unsigned int dim, const double *xmin, const double *xmax)
 evaluate the integral passing a new generic function
 
std::string Name () const
 return name of integrator
 
ROOT::Math::IntegratorMultiDimOptions Options () const
 retrieve the options
 
double Result () const
 return result of last integration
 
void SetAbsTolerance (double absTol)
 set absolute tolerance
 
void SetFunction (const IMultiGenFunction &f)
 
template<class Function >
void SetFunction (Function &f, unsigned int dim)
 set integration function using a generic function implementing the operator()(double *x) The dimension of the function is in this case required
 
void SetOptions (const ROOT::Math::IntegratorMultiDimOptions &opt)
 set the options
 
void SetRelTolerance (double relTol)
 set the relative tolerance
 
int Status () const
 return the Error Status of the last Integral calculation
 

Static Public Member Functions

static std::string GetName (IntegrationMultiDim::Type)
 static function to get a string from the enumeration
 
static IntegrationMultiDim::Type GetType (const char *name)
 static function to get the enumeration from a string
 

Protected Member Functions

VirtualIntegratorMultiDimCreateIntegrator (IntegrationMultiDim::Type type, double absTol, double relTol, unsigned int ncall)
 

Private Member Functions

 IntegratorMultiDim (const IntegratorMultiDim &)
 
IntegratorMultiDimoperator= (const IntegratorMultiDim &)
 

Private Attributes

std::unique_ptr< IMultiGenFunctionfFunc
 pointer to owned function
 
VirtualIntegratorMultiDimfIntegrator
 pointer to multi-dimensional integrator base class
 

#include <Math/IntegratorMultiDim.h>

Member Typedef Documentation

◆ Type

Constructor & Destructor Documentation

◆ IntegratorMultiDim() [1/3]

ROOT::Math::IntegratorMultiDim::IntegratorMultiDim ( IntegrationMultiDim::Type  type = IntegrationMultiDim::kDEFAULT,
double  absTol = -1,
double  relTol = -1,
unsigned int  ncall = 0 
)
inlineexplicit

Generic constructor of multi dimensional Integrator.

By default uses the Adaptive integration method

Parameters
typeintegration type (adaptive, MC methods, etc..)
absToldesired absolute Error
relToldesired relative Error
ncallnumber of function calls (apply only to MC integration methods)

In case no parameter values are passed the default ones used in IntegratorMultiDimOptions are used

Definition at line 68 of file IntegratorMultiDim.h.

◆ IntegratorMultiDim() [2/3]

ROOT::Math::IntegratorMultiDim::IntegratorMultiDim ( const IMultiGenFunction f,
IntegrationMultiDim::Type  type = IntegrationMultiDim::kDEFAULT,
double  absTol = -1,
double  relTol = -1,
unsigned int  ncall = 0 
)
inlineexplicit

Generic Constructor of multi dimensional Integrator passing a function.

By default uses the adaptive integration method

Parameters
fintegration function (multi-dim interface)
typeintegration type (adaptive, MC methods, etc..)
absToldesired absolute Error
relToldesired relative Error
ncallnumber of function calls (apply only to MC integration methods)

Definition at line 83 of file IntegratorMultiDim.h.

◆ ~IntegratorMultiDim()

virtual ROOT::Math::IntegratorMultiDim::~IntegratorMultiDim ( )
inlinevirtual

Template Constructor of multi dimensional Integrator passing a generic function.

By default uses the adaptive integration method

Parameters
fintegration function (generic function implementing operator()(const double *)
dimfunction dimension
typeintegration type (adaptive, MC methods, etc..)
absToldesired absolute Error
relToldesired relative Error
ncallnumber of function calls (apply only to MC integration methods) destructor

Definition at line 109 of file IntegratorMultiDim.h.

◆ IntegratorMultiDim() [3/3]

ROOT::Math::IntegratorMultiDim::IntegratorMultiDim ( const IntegratorMultiDim )
inlineprivate

Definition at line 117 of file IntegratorMultiDim.h.

Member Function Documentation

◆ CreateIntegrator()

VirtualIntegratorMultiDim * ROOT::Math::IntegratorMultiDim::CreateIntegrator ( IntegrationMultiDim::Type  type,
double  absTol,
double  relTol,
unsigned int  ncall 
)
protected

Definition at line 178 of file Integrator.cxx.

◆ Error()

double ROOT::Math::IntegratorMultiDim::Error ( ) const
inline

return integration error

Definition at line 163 of file IntegratorMultiDim.h.

◆ GetIntegrator()

VirtualIntegratorMultiDim * ROOT::Math::IntegratorMultiDim::GetIntegrator ( )
inline

return a pointer to integrator object

Definition at line 184 of file IntegratorMultiDim.h.

◆ GetName()

std::string ROOT::Math::IntegratorMultiDim::GetName ( IntegrationMultiDim::Type  type)
static

static function to get a string from the enumeration

Definition at line 90 of file Integrator.cxx.

◆ GetType()

IntegrationMultiDim::Type ROOT::Math::IntegratorMultiDim::GetType ( const char *  name)
static

static function to get the enumeration from a string

Definition at line 78 of file Integrator.cxx.

◆ Integral() [1/3]

double ROOT::Math::IntegratorMultiDim::Integral ( const double xmin,
const double xmax 
)
inline

evaluate the integral with the previously given function between xmin[] and xmax[]

Definition at line 126 of file IntegratorMultiDim.h.

◆ Integral() [2/3]

double ROOT::Math::IntegratorMultiDim::Integral ( const IMultiGenFunction f,
const double xmin,
const double xmax 
)
inline

evaluate the integral passing a new function

Definition at line 131 of file IntegratorMultiDim.h.

◆ Integral() [3/3]

template<class Function >
double ROOT::Math::IntegratorMultiDim::Integral ( Function f,
unsigned int  dim,
const double xmin,
const double xmax 
)
inline

evaluate the integral passing a new generic function

Definition at line 138 of file IntegratorMultiDim.h.

◆ Name()

std::string ROOT::Math::IntegratorMultiDim::Name ( ) const
inline

return name of integrator

Definition at line 187 of file IntegratorMultiDim.h.

◆ operator=()

IntegratorMultiDim & ROOT::Math::IntegratorMultiDim::operator= ( const IntegratorMultiDim )
inlineprivate

Definition at line 118 of file IntegratorMultiDim.h.

◆ Options()

ROOT::Math::IntegratorMultiDimOptions ROOT::Math::IntegratorMultiDim::Options ( ) const
inline

retrieve the options

Definition at line 181 of file IntegratorMultiDim.h.

◆ Result()

double ROOT::Math::IntegratorMultiDim::Result ( ) const
inline

return result of last integration

Definition at line 160 of file IntegratorMultiDim.h.

◆ SetAbsTolerance()

void ROOT::Math::IntegratorMultiDim::SetAbsTolerance ( double  absTol)
inline

set absolute tolerance

Definition at line 175 of file IntegratorMultiDim.h.

◆ SetFunction() [1/2]

void ROOT::Math::IntegratorMultiDim::SetFunction ( const IMultiGenFunction f)
inline

Definition at line 155 of file IntegratorMultiDim.h.

◆ SetFunction() [2/2]

template<class Function >
void ROOT::Math::IntegratorMultiDim::SetFunction ( Function f,
unsigned int  dim 
)
inline

set integration function using a generic function implementing the operator()(double *x) The dimension of the function is in this case required

Definition at line 149 of file IntegratorMultiDim.h.

◆ SetOptions()

void ROOT::Math::IntegratorMultiDim::SetOptions ( const ROOT::Math::IntegratorMultiDimOptions opt)
inline

set the options

Definition at line 178 of file IntegratorMultiDim.h.

◆ SetRelTolerance()

void ROOT::Math::IntegratorMultiDim::SetRelTolerance ( double  relTol)
inline

set the relative tolerance

Definition at line 172 of file IntegratorMultiDim.h.

◆ Status()

int ROOT::Math::IntegratorMultiDim::Status ( ) const
inline

return the Error Status of the last Integral calculation

Definition at line 166 of file IntegratorMultiDim.h.

Member Data Documentation

◆ fFunc

std::unique_ptr<IMultiGenFunction> ROOT::Math::IntegratorMultiDim::fFunc
private

pointer to owned function

Definition at line 202 of file IntegratorMultiDim.h.

◆ fIntegrator

VirtualIntegratorMultiDim* ROOT::Math::IntegratorMultiDim::fIntegrator
private

pointer to multi-dimensional integrator base class

Definition at line 201 of file IntegratorMultiDim.h.

Libraries for ROOT::Math::IntegratorMultiDim:

The documentation for this class was generated from the following files: