Naive generalized multi-dimensional integration. More...
Naively combine several one-dimensional integration objects from class inte in order to perform a multi-dimensional integration. The integration routines are specified in the function set_ptrs().
The integration routines are called in order of the index specified in the function set_oned_inte(). For n-
dimensional integration, n
one-dimensional integration objects should be specified, with indexes 0
through n-1
. The integration routines are called in order of their index, so that the outermost integration is done by the routine specified with index 0. The integral performed is:
This class is particularly useful if is time-consuming to evaluate, and separable from
.
See the discussion about the functions func
, lower
and upper
in the documentation for the class inte_gen.
No error estimate is performed. Error estimation for multiple dimension integrals is provided by the Monte Carlo integration classes (see Monte Carlo Integration).
Definition at line 79 of file inte_gen_comp.h.
#include <inte_gen_comp.h>
Public Member Functions | |
int | set_oned_inte (inte<> &it, size_t i) |
Set the one-dimensional integration object with index i . | |
virtual double | ginteg (func_t &func, size_t n, func_t &lower, func_t &upper) |
Integrate function func from ![]() ![]() ![]() | |
virtual const char * | type () |
Return string denoting type ("inte_gen_comp") | |
![]() | |
virtual double | ginteg (func_t &func, size_t ndim, lfunc_t &a, ufunc_t &b)=0 |
Integrate function func from ![]() ![]() ![]() | |
virtual int | ginteg_err (func_t &func, size_t ndim, lfunc_t &a, ufunc_t &b, double &res, double &err) |
Integrate function func from ![]() ![]() ![]() | |
double | get_error () |
Return the error in the result from the last call to ginteg() or ginteg_err() More... | |
const char * | type () |
Return string denoting type ("inte_gen") | |
Data Fields | |
size_t | max_dim |
The maxiumum number of integration dimensions (default 100) | |
![]() | |
int | verbose |
Verbosity. | |
double | tol_rel |
The maximum "uncertainty" in the value of the integral. | |
bool | err_nonconv |
If true, call the error handler if the routine does not "converge". | |
Protected Member Functions | |
double | odfunc (double x, size_t &ix) |
The one-dimensional integration function. | |
Protected Attributes | |
vec_t * | cx |
The independent variable vector. | |
lfunc_t * | lowerp |
The function specifying the lower limits. | |
ufunc_t * | upperp |
The function specifying the upper limits. | |
func_t * | mf |
The function to be integrated. | |
size_t | ndim |
The number of dimensions. | |
size_t | nint |
The size of the integration object arrays. | |
inte ** | iptrs |
Pointers to the integration objects. | |
bool * | tptrs |
Flag indicating if integration object has been set. | |
![]() | |
double | interror |
The uncertainty for the last integration computation. | |
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).
Hosted at
.