Object-oriented Scientific Computing Library: Version 0.910
Public Member Functions | Data Fields | Protected Attributes
gen_inte< func_t, lfunc_t, ufunc_t, vec_t > Class Template Reference

Generalized multi-dimensional integration [abstract base]. More...

#include <gen_inte.h>

Inheritance diagram for gen_inte< func_t, lfunc_t, ufunc_t, vec_t >:
comp_gen_inte< func_t, lfunc_t, ufunc_t, vec_t, alloc_vec_t, alloc_t >

Detailed Description

template<class func_t, class lfunc_t, class ufunc_t, class vec_t = ovector_base>
class gen_inte< func_t, lfunc_t, ufunc_t, vec_t >

Perform the generalized multi-dimensional integral:

\[ \int_{x_0=a_0}^{x_0=b_0} f(x_0) \int_{x_1=a_1(x_0)}^{x_1=b_1(x_0)} f(x_0, x_1) ... \int_{x_{\mathrm{n}-1}=a_{\mathrm{n}-1}(x_0,x_1,..,x_{\mathrm{n}-2})}^ {x_{\mathrm{n}-1}=b_{\mathrm{n}-1}(x_0,x_1,..,x_{\mathrm{n}-2})} f(x_0,x_1,...,x_{\mathrm{n-1}})~d x_{\mathrm{n}-1}~...~d x_1~d x_0 \]

The functions $ a_i $ and $ b_i $ are specified in the arguments a and b to the function ginteg() or ginteg_err() .

In order to allow the user to specify only three functions (for the integrand, the lower limits, and the upper limits) the first argument to the limit and integrand functions is used to distinguish among the limits for each separate integral. So first argument to a for $ a_0() $ is 0, and the first argument to a for $ a_1() $ is 1, etc., and similarly for the upper limits specified in b and the integrands specified in func.

At present, the only implementation of this abstract base is in comp_gen_inte .

Idea for Future:
It might be interesting to construct a child class of gen_inte which automatically transforms variables to a hypercube and then applies a child of multi_inte to do the integration.

Definition at line 62 of file gen_inte.h.

Public Member Functions

virtual double ginteg (func_t &func, size_t ndim, lfunc_t &a, ufunc_t &b)=0
 Integrate function func from $ x_i=a_i(x_i) $ to $ x_i=b_i(x_i) $ for $ 0<i<\mathrm{ndim}-1 $.
virtual int ginteg_err (func_t &func, size_t ndim, lfunc_t &a, ufunc_t &b, double &res, double &err)
 Integrate function func from $ x_i=a_i(x_i) $ to $ x_i=b_i(x_i) $ for $ 0<i<\mathrm{ndim}-1 $.
double get_error ()
 Return the error in the result from the last call to ginteg() or ginteg_err()
const char * type ()
 Return string denoting type ("gen_inte")

Data Fields

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 Attributes

double interror
 The uncertainty for the last integration computation.

Member Function Documentation

template<class func_t , class lfunc_t , class ufunc_t , class vec_t = ovector_base>
double gen_inte< func_t, lfunc_t, ufunc_t, vec_t >::get_error ( ) [inline]

This will quietly return zero if no integrations have been performed.

Definition at line 108 of file gen_inte.h.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).

Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads.