Example on the usage of the multidimensional integration algorithm of MathMore Please refer to the web documentation for further details: https://root.cern.ch/root/htmldoc/guides/users-guide/MathLibraries.html#numerical-integration To execute the macro type the following:
root[0] .x mathmoreIntegrationMultidim.C
This tutorial requires having libMathMore built with ROOT.
To build mathmore you need to have a version of GSL >= 1.8 installed in your system The ROOT configure will automatically find GSL if the script gsl-config (from GSL) is in your PATH,. otherwise you need to configure root with the options –gsl-incdir and –gsl-libdir.
integral result is 1
integral result is 0.999998
integral result is 0.999738
integral result is 0.999881
(int) 0
double f2(
const double *
x) {
}
int mathmoreIntegrationMultidim() {
const double RESULT = 1.0;
const double ERRORLIMIT = 1E-3;
int status = 0;
ig.SetFunction(wf);
double val = ig.Integral(
a,
b);
std::cout << "integral result is " << val << std::endl;
status += std::fabs(val-RESULT) > ERRORLIMIT;
ig2.SetFunction(wf);
std::cout << "integral result is " << val << std::endl;
status += std::fabs(val-RESULT) > ERRORLIMIT;
std::cout << "integral result is " << val << std::endl;
status += std::fabs(val-RESULT) > ERRORLIMIT;
std::cout << "integral result is " << val << std::endl;
status += std::fabs(val-RESULT) > ERRORLIMIT;
return status;
}
Documentation for class Functor class.
User class for performing multidimensional integration.
@ kADAPTIVE
adaptive multi-dimensional integration
- Authors
- A. Tolosa-Delgado
Definition in file mathmoreIntegrationMultidim.C.