ROOT 6.18/05 Reference Guide |
Class for adaptive quadrature integration in multi-dimensions using rectangular regions.
Algorithm from A.C. Genz, A.A. Malik, An adaptive algorithm for numerical integration over an N-dimensional rectangular region, J. Comput. Appl. Math. 6 (1980) 295-302.
Converted/adapted by R.Brun to C++ from Fortran CERNLIB routine RADMUL (D120) The new code features many changes compared to the Fortran version.
Control parameters are:
The integral will stop if the relative error is less than relative tolerance OR the absolute error is less than the absolute tolerance
The class computes in addition to the integral of the function in the desired interval:
An integration rule of degree seven is used together with a certain strategy of subdivision. For a more detailed description of the method see References.
1..Multi-dimensional integration is time-consuming. For each rectangular subregion, the routine requires function evaluations. Careful programming of the integrand might result in substantial saving of time. 2..Numerical integration usually works best for smooth functions. Some analysis or suitable transformations of the integral prior to numerical work may contribute to numerical efficiency.
Definition at line 84 of file AdaptiveIntegratorMultiDim.h.
Public Member Functions | |
AdaptiveIntegratorMultiDim (const IMultiGenFunction &f, double absTol=0.0, double relTol=1E-9, unsigned int maxcall=100000, unsigned int size=0) | |
Construct with a reference to the integrand function and given optionally tolerance (absolute and relative), maximum number of function evaluation (maxpts) and size of the working array. More... | |
AdaptiveIntegratorMultiDim (double absTol=0.0, double relTol=1E-9, unsigned int maxpts=100000, unsigned int size=0) | |
Construct given optionally tolerance (absolute and relative), maximum number of function evaluation (maxpts) and size of the working array. More... | |
virtual | ~AdaptiveIntegratorMultiDim () |
destructor (no operations) More... | |
double | Error () const |
return integration error More... | |
double | Integral (const double *xmin, const double *xmax) |
evaluate the integral with the previously given function between xmin[] and xmax[] More... | |
double | Integral (const IMultiGenFunction &f, const double *xmin, const double *xmax) |
evaluate the integral passing a new function More... | |
int | NEval () const |
return number of function evaluations in calculating the integral More... | |
ROOT::Math::IntegratorMultiDimOptions | Options () const |
get the option used for the integration More... | |
double | RelError () const |
return relative error More... | |
double | Result () const |
return result of integration More... | |
void | SetAbsTolerance (double absTol) |
set absolute tolerance More... | |
void | SetFunction (const IMultiGenFunction &f) |
set the integration function (must implement multi-dim function interface: IBaseFunctionMultiDim) More... | |
void | SetMaxPts (unsigned int n) |
set max points More... | |
void | SetMinPts (unsigned int n) |
set min points More... | |
void | SetOptions (const ROOT::Math::IntegratorMultiDimOptions &opt) |
set the options More... | |
void | SetRelTolerance (double relTol) |
set relative tolerance More... | |
void | SetSize (unsigned int size) |
set workspace size More... | |
int | Status () const |
return status of integration More... | |
Public Member Functions inherited from ROOT::Math::VirtualIntegratorMultiDim | |
virtual | ~VirtualIntegratorMultiDim () |
destructor: no operation More... | |
virtual double | Integral (const double *, const double *)=0 |
evaluate multi-dim integral More... | |
virtual ROOT::Math::IntegratorMultiDimOptions | Options () const =0 |
get the option used for the integration impelement by derived class otherwise return default ones More... | |
virtual void | SetFunction (const IMultiGenFunction &)=0 |
setting a multi-dim function More... | |
virtual void | SetOptions (const ROOT::Math::IntegratorMultiDimOptions &opt) |
set the options (if needed must be re-implemented by derived classes) More... | |
virtual ROOT::Math::IntegrationMultiDim::Type | Type () const |
Public Member Functions inherited from ROOT::Math::VirtualIntegrator | |
virtual | ~VirtualIntegrator () |
virtual double | Error () const =0 |
return the estimate of the absolute Error of the last Integral calculation More... | |
virtual int | NEval () const |
return number of function evaluations in calculating the integral (if integrator do not implement this function returns -1) More... | |
virtual double | Result () const =0 |
return the Result of the last Integral calculation More... | |
virtual void | SetAbsTolerance (double)=0 |
set the desired absolute Error More... | |
virtual void | SetRelTolerance (double)=0 |
set the desired relative Error More... | |
virtual int | Status () const =0 |
return the Error Status of the last Integral calculation More... | |
Protected Member Functions | |
double | DoIntegral (const double *xmin, const double *xmax, bool absVal=false) |
Private Attributes | |
double | fAbsTol |
unsigned int | fDim |
double | fError |
const IMultiGenFunction * | fFun |
unsigned int | fMaxPts |
unsigned int | fMinPts |
int | fNEval |
double | fRelError |
double | fRelTol |
double | fResult |
unsigned int | fSize |
int | fStatus |
#include <Math/AdaptiveIntegratorMultiDim.h>
|
explicit |
Construct given optionally tolerance (absolute and relative), maximum number of function evaluation (maxpts) and size of the working array.
The integration will stop when the absolute error is less than the absolute tolerance OR when the relative error is less than the relative tolerance. The absolute tolerance by default is not used (it is equal to zero). The size of working array represents the number of sub-division used for calculating the integral. Higher the dimension, larger sizes are required for getting the same accuracy. The size must be larger than \( (2n + 3) (1 + maxpts/(2^n + 2n(n + 1) + 1))/2) \). For smaller value passed, the minimum allowed will be used
Definition at line 17 of file AdaptiveIntegratorMultiDim.cxx.
|
explicit |
Construct with a reference to the integrand function and given optionally tolerance (absolute and relative), maximum number of function evaluation (maxpts) and size of the working array.
Definition at line 37 of file AdaptiveIntegratorMultiDim.cxx.
|
inlinevirtual |
destructor (no operations)
Definition at line 113 of file AdaptiveIntegratorMultiDim.h.
|
protected |
Definition at line 76 of file AdaptiveIntegratorMultiDim.cxx.
|
inlinevirtual |
return integration error
Implements ROOT::Math::VirtualIntegrator.
Definition at line 134 of file AdaptiveIntegratorMultiDim.h.
|
inlinevirtual |
evaluate the integral with the previously given function between xmin[] and xmax[]
Implements ROOT::Math::VirtualIntegratorMultiDim.
Definition at line 119 of file AdaptiveIntegratorMultiDim.h.
double ROOT::Math::AdaptiveIntegratorMultiDim::Integral | ( | const IMultiGenFunction & | f, |
const double * | xmin, | ||
const double * | xmax | ||
) |
evaluate the integral passing a new function
Definition at line 386 of file AdaptiveIntegratorMultiDim.cxx.
|
inlinevirtual |
return number of function evaluations in calculating the integral
Reimplemented from ROOT::Math::VirtualIntegrator.
Definition at line 152 of file AdaptiveIntegratorMultiDim.h.
|
virtual |
get the option used for the integration
Implements ROOT::Math::VirtualIntegratorMultiDim.
Definition at line 394 of file AdaptiveIntegratorMultiDim.cxx.
|
inline |
return relative error
Definition at line 137 of file AdaptiveIntegratorMultiDim.h.
|
inlinevirtual |
return result of integration
Implements ROOT::Math::VirtualIntegrator.
Definition at line 131 of file AdaptiveIntegratorMultiDim.h.
|
virtual |
set absolute tolerance
Implements ROOT::Math::VirtualIntegrator.
Definition at line 73 of file AdaptiveIntegratorMultiDim.cxx.
|
virtual |
set the integration function (must implement multi-dim function interface: IBaseFunctionMultiDim)
Implements ROOT::Math::VirtualIntegratorMultiDim.
Definition at line 63 of file AdaptiveIntegratorMultiDim.cxx.
|
inline |
set max points
Definition at line 167 of file AdaptiveIntegratorMultiDim.h.
|
inline |
set min points
Definition at line 164 of file AdaptiveIntegratorMultiDim.h.
|
virtual |
set the options
Reimplemented from ROOT::Math::VirtualIntegratorMultiDim.
Definition at line 405 of file AdaptiveIntegratorMultiDim.cxx.
|
virtual |
set relative tolerance
Implements ROOT::Math::VirtualIntegrator.
Definition at line 70 of file AdaptiveIntegratorMultiDim.cxx.
|
inline |
set workspace size
Definition at line 161 of file AdaptiveIntegratorMultiDim.h.
|
inlinevirtual |
return status of integration
Implements ROOT::Math::VirtualIntegrator.
Definition at line 149 of file AdaptiveIntegratorMultiDim.h.
|
private |
Definition at line 186 of file AdaptiveIntegratorMultiDim.h.
|
private |
Definition at line 182 of file AdaptiveIntegratorMultiDim.h.
|
private |
Definition at line 190 of file AdaptiveIntegratorMultiDim.h.
|
private |
Definition at line 195 of file AdaptiveIntegratorMultiDim.h.
|
private |
Definition at line 184 of file AdaptiveIntegratorMultiDim.h.
|
private |
Definition at line 183 of file AdaptiveIntegratorMultiDim.h.
|
private |
Definition at line 192 of file AdaptiveIntegratorMultiDim.h.
|
private |
Definition at line 191 of file AdaptiveIntegratorMultiDim.h.
|
private |
Definition at line 187 of file AdaptiveIntegratorMultiDim.h.
|
private |
Definition at line 189 of file AdaptiveIntegratorMultiDim.h.
|
private |
Definition at line 185 of file AdaptiveIntegratorMultiDim.h.
|
private |
Definition at line 193 of file AdaptiveIntegratorMultiDim.h.