Adaptive Cauchy principal value integration (GSL) More...
#include <inte_qawc_gsl.h>
The Cauchy principal value of the integral of
over with a singularity at
is computed. The adaptive refinement algorithm described for inte_qag_gsl is used with modifications to ensure that subdivisions do not occur at the singular point
. When a subinterval contains the point
or is close to it, a special 25-point modified Clenshaw-Curtis rule is used to control the singularity. Further away from the singularity the algorithm uses a Gauss-Kronrod integration rule.
The location of the singularity must be specified before-hand in inte_qawc_gsl::s, and the singularity must not be at one of the endpoints. Note that when integrating a function of the form , the denominator
must not be specified in the argument
func
to integ(). Note that this is different from how the inte_cauchy_cern operates.
See GSL-based integration routines in the User's guide for general information about the GSL integration classes.
Definition at line 351 of file inte_qawc_gsl.h.
Public Member Functions | |
virtual int | integ_err (func_t &func, double a, double b, double &res, double &err) |
Integrate function func from a to b and place the result in res and the error in err . | |
![]() | |
virtual void | gauss_kronrod (func_t &func, double a, double b, double *result, double *abserr, double *resabs, double *resasc) |
Integration wrapper for internal transformed function type. | |
![]() | |
int | get_rule () |
Get the Gauss-Kronrod integration rule. More... | |
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) More... | |
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. More... | |
![]() | |
virtual double | integ (func_t &func, double a, double b) |
Integrate function func from a to b . | |
double | get_error () |
Return the numerically estimated error in the result from the last call to integ() More... | |
Public Attributes | |
double | s |
The singularity. | |
![]() | |
int | verbose |
Verbosity. | |
size_t | last_iter |
The most recent number of iterations taken. | |
double | tol_rel |
The maximum relative uncertainty in the value of the integral (default ![]() | |
double | tol_abs |
The maximum absolute uncertainty in the value of the integral (default ![]() | |
bool | err_nonconv |
If true, call the error handler if the routine does not converge or reach the desired tolerance (default true) More... | |
Protected Member Functions | |
int | qawc (func_t &func, const double a, const double b, const double c, const double epsabs, const double epsrel, double *result, double *abserr) |
The full GSL integration routine called by integ_err() | |
void | qc25c (func_t &func, double a, double b, double c, double *result, double *abserr, int *err_reliable) |
25-point quadrature for Cauchy principal values | |
virtual double | transform (double t, func_t &func) |
Add the singularity to the function. | |
const char * | type () |
Return string denoting type ("inte_qawc_gsl") | |
![]() | |
void | compute_moments (double cc, double *moment) |
Compute the Chebyshev moments. | |
template<class func2_t > | |
void | inte_cheb_series (func2_t &f, double a, double b, double *cheb12, double *cheb24) |
Compute Chebyshev series expansion using a FFT method. More... | |
![]() | |
void | initialise_table (struct extrapolation_table *table) |
Initialize the table. | |
void | append_table (struct extrapolation_table *table, double y) |
Append a result to the table. | |
int | test_positivity (double result, double resabs) |
Test if the integrand satisfies ![]() | |
void | qelg (struct extrapolation_table *table, double *result, double *abserr) |
Determines the limit of a given sequence of approximations. More... | |
int | large_interval (inte_workspace_gsl *workspace) |
Determine if an interval is large. | |
void | reset_nrmax (inte_workspace_gsl *workspace) |
Reset workspace to work on the interval with the largest error. | |
int | increase_nrmax (inte_workspace_gsl *workspace) |
Increase workspace. | |
int | qags (func_t &func, const double a, const double b, const double l_epsabs, const double l_epsrel, double *result, double *abserr) |
Integration function. More... | |
![]() | |
double | rescale_error (double err, const double result_abs, const double result_asc) |
QUADPACK's nonlinear rescaling of the absolute-error estimate. More... | |
Additional Inherited Members | |
![]() | |
typedef struct o2scl::inte_singular_gsl::extrapolation_table | extrap_table |
A structure for extrapolation for inte_qags_gsl. More... | |
![]() | |
inte_workspace_gsl * | w |
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. | |
![]() | |
double | interror |
The uncertainty for the last integration computation. | |
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).