gen_inte Class Template Reference

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

#include <gen_inte.h>

Inheritance diagram for gen_inte:

comp_gen_inte

Detailed Description

template<class param_t, class func_t, class lfunc_t, class ufunc_t, class vec_t = ovector_base>
class gen_inte< param_t, 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 .

Definition at line 59 of file gen_inte.h.


Public Member Functions

virtual double ginteg (func_t &func, size_t ndim, lfunc_t &a, ufunc_t &b, param_t &pa)=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, param_t &pa, 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 tolf
 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

double get_error (  )  [inline]

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

Definition at line 109 of file gen_inte.h.

virtual double ginteg ( func_t &  func,
size_t  ndim,
lfunc_t &  a,
ufunc_t &  b,
param_t &  pa 
) [pure virtual]

virtual int ginteg_err ( func_t &  func,
size_t  ndim,
lfunc_t &  a,
ufunc_t &  b,
param_t &  pa,
double &  res,
double &  err 
) [inline, virtual]

Definition at line 96 of file gen_inte.h.


The documentation for this class was generated from the following file:

Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.

Project hosting provided by SourceForge.net Logo, O2scl Sourceforge Project Page