ROOT
6.07/01
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:
minpts: Minimum number of function evaluations requested. Must not exceed maxpts. if minpts < 1 minpts is set to 2^n +2*n*(n+1) +1 where n is the function dimension
maxpts: Maximum number of function evaluations to be allowed. maxpts >= 2^n +2*n*(n+1) +1 if maxpts<minpts, maxpts is set to 10*minpts epstol, epsrel : Specified relative and absolute accuracy.
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 is the desired interval:
an estimation of the relative accuracy of the result. number of function evaluations performed. status code : 0 Normal exit. . At least minpts and at most maxpts calls to the function were performed. 1 maxpts is too small for the specified accuracy eps. The result and relerr contain the values obtainable for the specified value of maxpts. 3 n<2 or n>15
Method:
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.
Notes:
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.
References:
1.A.C. Genz and A.A. Malik, Remarks on algorithm 006: An adaptive algorithm for numerical integration over an N-dimensional rectangular region, J. Comput. Appl. Math. 6 (1980) 295-302. 2.A. van Doren and L. de Ridder, An adaptive algorithm for numerical integration over an n-dimensional cube, J.Comput. Appl. Math. 2 (1976) 207-217.
Definition at line 89 of file AdaptiveIntegratorMultiDim.h.
Public Member Functions | |
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... | |
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... | |
virtual | ~AdaptiveIntegratorMultiDim () |
destructor (no operations) 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... | |
void | SetFunction (const IMultiGenFunction &f) |
set the integration function (must implement multi-dim function interface: IBaseFunctionMultiDim) More... | |
double | Result () const |
return result of integration More... | |
double | Error () const |
return integration error More... | |
double | RelError () const |
return relative error More... | |
int | Status () const |
return status of integration More... | |
int | NEval () const |
return number of function evaluations in calculating the integral More... | |
void | SetRelTolerance (double relTol) |
set relative tolerance More... | |
void | SetAbsTolerance (double absTol) |
set absolute tolerance More... | |
void | SetSize (unsigned int size) |
set workspace size More... | |
void | SetMinPts (unsigned int n) |
set min points More... | |
void | SetMaxPts (unsigned int n) |
set max points More... | |
void | SetOptions (const ROOT::Math::IntegratorMultiDimOptions &opt) |
set the options More... | |
ROOT::Math::IntegratorMultiDimOptions | Options () const |
get the option used for the integration More... | |
Public Member Functions inherited from ROOT::Math::VirtualIntegratorMultiDim | |
virtual | ~VirtualIntegratorMultiDim () |
destructor: no operation More... | |
virtual ROOT::Math::IntegrationMultiDim::Type | Type () const |
Public Member Functions inherited from ROOT::Math::VirtualIntegrator | |
virtual | ~VirtualIntegrator () |
Protected Member Functions | |
double | DoIntegral (const double *xmin, const double *xmax, bool absVal=false) |
Private Attributes | |
unsigned int | fDim |
unsigned int | fMinPts |
unsigned int | fMaxPts |
unsigned int | fSize |
double | fAbsTol |
double | fRelTol |
double | fResult |
double | fError |
double | fRelError |
int | fNEval |
int | fStatus |
const IMultiGenFunction * | fFun |
#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 defult 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 117 of file AdaptiveIntegratorMultiDim.h.
|
protected |
Definition at line 76 of file AdaptiveIntegratorMultiDim.cxx.
Referenced by Integral().
|
inlinevirtual |
return integration error
Implements ROOT::Math::VirtualIntegrator.
Definition at line 138 of file AdaptiveIntegratorMultiDim.h.
Referenced by DoIntegral(), and integral_num().
|
inlinevirtual |
evaluate the integral with the previously given function between xmin[] and xmax[]
Implements ROOT::Math::VirtualIntegratorMultiDim.
Definition at line 123 of file AdaptiveIntegratorMultiDim.h.
Referenced by RooAdaptiveIntegratorND::integral(), Integral(), integral_num(), and TF1::IntegralMultiple().
double ROOT::Math::AdaptiveIntegratorMultiDim::Integral | ( | const IMultiGenFunction & | f, |
const double * | xmin, | ||
const double * | xmax | ||
) |
evaluate the integral passing a new function
Definition at line 385 of file AdaptiveIntegratorMultiDim.cxx.
|
inlinevirtual |
return number of function evaluations in calculating the integral
Reimplemented from ROOT::Math::VirtualIntegrator.
Definition at line 147 of file AdaptiveIntegratorMultiDim.h.
Referenced by integral_num(), and TF1::IntegralMultiple().
|
virtual |
get the option used for the integration
Implements ROOT::Math::VirtualIntegratorMultiDim.
Definition at line 393 of file AdaptiveIntegratorMultiDim.cxx.
|
inline |
return relative error
Definition at line 141 of file AdaptiveIntegratorMultiDim.h.
Referenced by RooAdaptiveIntegratorND::integral(), and TF1::IntegralMultiple().
|
inlinevirtual |
return result of integration
Implements ROOT::Math::VirtualIntegrator.
Definition at line 135 of file AdaptiveIntegratorMultiDim.h.
Referenced by integral_num().
set absolute tolerance
Implements ROOT::Math::VirtualIntegrator.
Definition at line 73 of file AdaptiveIntegratorMultiDim.cxx.
Referenced by SetOptions().
|
virtual |
set the integration function (must implement multi-dim function interface: IBaseFunctionMultiDim)
Implements ROOT::Math::VirtualIntegratorMultiDim.
Definition at line 63 of file AdaptiveIntegratorMultiDim.cxx.
Referenced by integral_num(), and RooAdaptiveIntegratorND::RooAdaptiveIntegratorND().
|
inline |
set max points
Definition at line 162 of file AdaptiveIntegratorMultiDim.h.
Referenced by SetOptions().
|
inline |
set min points
Definition at line 159 of file AdaptiveIntegratorMultiDim.h.
|
virtual |
set the options
Reimplemented from ROOT::Math::VirtualIntegratorMultiDim.
Definition at line 404 of file AdaptiveIntegratorMultiDim.cxx.
set relative tolerance
Implements ROOT::Math::VirtualIntegrator.
Definition at line 70 of file AdaptiveIntegratorMultiDim.cxx.
Referenced by SetOptions().
|
inline |
set workspace size
Definition at line 156 of file AdaptiveIntegratorMultiDim.h.
Referenced by SetOptions().
|
inlinevirtual |
return status of integration
Implements ROOT::Math::VirtualIntegrator.
Definition at line 144 of file AdaptiveIntegratorMultiDim.h.
Referenced by RooAdaptiveIntegratorND::integral(), and TF1::IntegralMultiple().
|
private |
Definition at line 181 of file AdaptiveIntegratorMultiDim.h.
Referenced by AdaptiveIntegratorMultiDim(), DoIntegral(), Options(), and SetAbsTolerance().
|
private |
Definition at line 177 of file AdaptiveIntegratorMultiDim.h.
Referenced by DoIntegral(), and SetFunction().
|
private |
Definition at line 185 of file AdaptiveIntegratorMultiDim.h.
Referenced by DoIntegral(), and Error().
|
private |
Definition at line 190 of file AdaptiveIntegratorMultiDim.h.
Referenced by DoIntegral(), Integral(), and SetFunction().
|
private |
Definition at line 179 of file AdaptiveIntegratorMultiDim.h.
Referenced by AdaptiveIntegratorMultiDim(), DoIntegral(), Options(), and SetMaxPts().
|
private |
Definition at line 178 of file AdaptiveIntegratorMultiDim.h.
Referenced by DoIntegral(), and SetMinPts().
|
private |
Definition at line 187 of file AdaptiveIntegratorMultiDim.h.
Referenced by DoIntegral(), and NEval().
|
private |
Definition at line 186 of file AdaptiveIntegratorMultiDim.h.
Referenced by DoIntegral(), and RelError().
|
private |
Definition at line 182 of file AdaptiveIntegratorMultiDim.h.
Referenced by AdaptiveIntegratorMultiDim(), DoIntegral(), Options(), and SetRelTolerance().
|
private |
Definition at line 184 of file AdaptiveIntegratorMultiDim.h.
Referenced by DoIntegral(), and Result().
|
private |
Definition at line 180 of file AdaptiveIntegratorMultiDim.h.
Referenced by AdaptiveIntegratorMultiDim(), DoIntegral(), Options(), and SetSize().
|
private |
Definition at line 188 of file AdaptiveIntegratorMultiDim.h.
Referenced by DoIntegral(), and Status().