Object-oriented Scientific Computing Library: Version 0.910
Public Member Functions | Protected Attributes
gsl_inte_kronrod< func_t > Class Template Reference

Basic Gauss-Kronrod integration class (GSL) More...

#include <gsl_inte_kronrod.h>

Inheritance diagram for gsl_inte_kronrod< func_t >:
gsl_inte inte< func_t > gsl_inte_qag< func_t > gsl_inte_singular< func_t > gsl_inte_qags< func_t > gsl_inte_transform< func_t > gsl_inte_cheb< func_t > gsl_inte_qagi< func_t > gsl_inte_qagil< func_t > gsl_inte_qagiu< func_t > gsl_inte_qawc< func_t > gsl_inte_qawo_sin< func_t > gsl_inte_qaws< func_t > gsl_inte_qawf_sin< func_t > gsl_inte_qawo_cos< func_t > gsl_inte_qawf_cos< func_t >

Detailed Description

template<class func_t>
class gsl_inte_kronrod< func_t >

This class provides the basic Gauss-Kronrod integration function and integration workspace for some of the GSL-based integration classes.

The main function of interest is set_rule(), which sets the integration rule for the GSL integration classes which inherit from this base class. The argument to set rule should be selected from the following list:

The integration coefficients for use with this class and associated children are stored in the o2scl_inte_gk_coeffs namespace.

Idea for Future:
Convert 'double *' objects to uvector

Definition at line 610 of file gsl_inte_kronrod.h.

Public Member Functions

int get_rule ()
 Get the Gauss-Kronrod integration rule.
void set_rule (int rule)
 Set the Gauss-Kronrod integration rule to be used.
int set_limit (size_t lim)
 Set the limit for the number of subdivisions of the integration region (default 1000)
template<class func2_t >
void gauss_kronrod_base (func2_t &func, double a, double b, double *result, double *abserr, double *resabs, double *resasc)
 The base Gauss-Kronrod integration function template.
virtual void gauss_kronrod (func_t &func, double a, double b, double *result, double *abserr, double *resabs, double *resasc)
 Integration wrapper for user-specified function type.

Protected Attributes

gsl_inte_workspacew
 The integration workspace.
int n_gk
 Size of Gauss-Kronrod arrays.
const double * x_gk
 Gauss-Kronrod abscissae pointer.
const double * w_g
 Gauss weight pointer.
const double * w_gk
 Gauss-Kronrod weight pointer.
double * f_v1
 Scratch space.
double * f_v2
 Scratch space.

Member Function Documentation

template<class func_t >
int gsl_inte_kronrod< func_t >::get_rule ( ) [inline]

This returns the index of the GSL integration rule a number between 1 and 6 (inclusive)

Definition at line 659 of file gsl_inte_kronrod.h.

template<class func_t >
int gsl_inte_kronrod< func_t >::set_limit ( size_t  lim) [inline]

If the value of size is zero, the error handler will be called.

Definition at line 741 of file gsl_inte_kronrod.h.

template<class func_t >
template<class func2_t >
void gsl_inte_kronrod< func_t >::gauss_kronrod_base ( func2_t &  func,
double  a,
double  b,
double *  result,
double *  abserr,
double *  resabs,
double *  resasc 
) [inline]

Given abcissas and weights, this performs the integration of func between a and b, providing a result with uncertainties.

The Gauss-Kronrod rule uses $ 2m+1 $ abscissae $ x_1, \ldots, x_{2m+1} \in (a, b) $ to estimate the integral of a function as a linear combination of values,

\[ \int_a^b f~dx \; \approx \; Q_m^{GK}f \; \equiv \; \sum_{k=1}^{2m+1} \beta_k f(x_k), \]

where the weights $ \beta_1,\ldots, \beta_{2m+1} $ are intrinsic to the abscissae. The data are designed so that the even-indexed abscissae yield a coarser estimate,

\[ Q_m^{G}f \; \equiv \; \sum_{j=1}^{m} \alpha_j f(x_{2j}), \]

and their difference $ |Q_m^Gf - Q_m^{GK}f| $ is the "raw" error estimate. The various quantities that the function computes are

\begin{eqnarray*} \mathtt{result} &=& Q_m^{GK}f, \\ \mathtt{resabs} &=& Q_m^{GK}|f|, \\ \mathtt{resasc} &=& Q_m^{GK}(|f| - \mu), \quad \mu \equiv \frac{Q_m^{GK}f}{b - a}. \end{eqnarray*}

The "absolute" error abserr is computed from the raw error value using the function gsl_inte::rescale_error.

This function is designed for use with the values given in the o2scl_inte_gk_coeffs namespace.

This function never calls the error handler.

Idea for Future:
This function, in principle, is an integration object in and of itself, and could be implemented separately as an object of type inte.

Definition at line 794 of file gsl_inte_kronrod.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.