Go to the first, previous, next, last section, table of contents.

QAWS adaptive integration for singular functions

The QAWS algorithm is designed for integrands with algebraic-logarithmic singularities at the end-points of an integration region. In order to work efficiently the algorithm requires a precomputed table of Chebyschev moments.

Function: gsl_integration_qaws_table * gsl_integration_qaws_table_alloc (double alpha, double beta, int mu, int nu)

This function allocates space for a gsl_integration_qaws_table struct and associated workspace describing a singular weight function @math{W(x)} with the parameters @math{(\alpha, \beta, \mu, \nu)},

where @math{\alpha < -1}, @math{\beta < -1}, and @math{\mu = 0, 1}, @math{\nu = 0, 1}. The weight function can take four different forms depending on the values of @math{\mu} and @math{\nu},

The singular points @math{(a,b)} do not have to be specified until the integral is computed, where they are the endpoints of the integration range.

The function returns a pointer to the newly allocated gsl_integration_qaws_table if no errors were detected, and 0 in the case of error.

Function: int gsl_integration_qaws_table_set (gsl_integration_qaws_table * t, double alpha, double beta, int mu, int nu)
This function modifies the parameters @math{(\alpha, \beta, \mu, \nu)} of an existing gsl_integration_qaws_table struct t.

Function: void gsl_integration_qaws_table_free (gsl_integration_qaws_table * t)
This function frees all the memory associated with the gsl_integration_qaws_table struct t.

Function: int gsl_integration_qaws (gsl_function * f, const double a, const double b, gsl_integration_qaws_table * t, const double epsabs, const double epsrel, const size_t limit, gsl_integration_workspace * workspace, double *result, double *abserr)

This function computes the integral of the function @math{f(x)} over the interval @math{(a,b)} with the singular weight function @math{(x-a)^\alpha (b-x)^\beta \log^\mu (x-a) \log^\nu (b-x)}. The parameters of the weight function @math{(\alpha, \beta, \mu, \nu)} are taken from the table t. The integral is,

The adaptive bisection algorithm of QAG is used. When a subinterval contains one of the endpoints then a special 25-point modified Clenshaw-Curtis rule is used to control the singularities. For subintervals which do not include the endpoints an ordinary 15-point Gauss-Kronrod integration rule is used.


Go to the first, previous, next, last section, table of contents.