Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
o2scl::inte_qaws_gsl< func_t > Class Template Reference

Adaptive integration with with algebraic-logarithmic singularities at the end-points (GSL) More...

#include <inte_qaws_gsl.h>

Inheritance diagram for o2scl::inte_qaws_gsl< func_t >:
o2scl::inte_cheb_gsl< func_t > o2scl::inte_transform_gsl< func_t > o2scl::inte_singular_gsl< func_t > o2scl::inte_kronrod_gsl< func_t > o2scl::inte_gsl o2scl::inte< func_t >

Public Member Functions

 inte_qaws_gsl ()
 Initialize the adptive workspace as with the constructor inte_qag_gsl::inte_qag_gsl. More...
int set_weight (double u_alpha, double u_beta, int u_mu, int u_nu)
 Sets the exponents of singularites of the weight function. More...
void get_weight (double &u_alpha, double &u_beta, int &u_mu, int &u_nu)
 Returns the current values (via reference) of the weight-function's parameters.
virtual int integ_err (func_t &func, double a, double b, double &result, double &abserr)
 Integrate the function func on the interval (a, b) returning the result and error estimate abserr.
const char * type ()
 Return string denoting type ("inte_qaws_gsl")
- Public Member Functions inherited from o2scl::inte_transform_gsl< func_t >
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.
- Public Member Functions inherited from o2scl::inte_kronrod_gsl< func_t >
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...
- Public Member Functions inherited from o2scl::inte< func_t >
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...

Protected Member Functions

void initialise_qaws_table ()
 Set the array values ri, rj, rg, rh from the current values alpha and beta. More...
virtual double transform (double t, func_t &func)
 Weighted integrand.
void qc25s (func_t &func, double a, double b, double a1, double b1, double &result, double &abserr, int &err_reliable)
 Clenshaw-Curtis 25-point integration and error estimator for functions with an algebraic-logarithmic singularity at the endpoint(s).
void compute_result (double *r, double *cheb12, double *cheb24, double &result12, double &result24)
 Compute the 13-point and 25-point approximations from the Chebyshev moments and coefficients.
- Protected Member Functions inherited from o2scl::inte_cheb_gsl< func_t >
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...
- Protected Member Functions inherited from o2scl::inte_singular_gsl< func_t >
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 $ f = |f| $.
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...
- Protected Member Functions inherited from o2scl::inte_gsl
double rescale_error (double err, const double result_abs, const double result_asc)
 QUADPACK's nonlinear rescaling of the absolute-error estimate. More...

Protected Attributes

bool fn_qaws_R
 True if algebraic-logarithmic singularity is present at the right endpoint in the definition f_trans.
bool fn_qaws_L
 True if algebraic-logarithmic singularity is present at the left endpoint in the definition f_trans.
double left_endpoint
 Left endpoint in definition of f_trans.
double right_endpoint
 Right endpoint in definition of f_trans.
Data from \c gsl_integration_qaws_table
double alpha
double beta
int mu
int nu
double ri [25]
double rj [25]
double rg [25]
double rh [25]
- Protected Attributes inherited from o2scl::inte_kronrod_gsl< func_t >
 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.
- Protected Attributes inherited from o2scl::inte< func_t >
double interror
 The uncertainty for the last integration computation.

Additional Inherited Members

- Public Types inherited from o2scl::inte_singular_gsl< func_t >
typedef struct o2scl::inte_singular_gsl::extrapolation_table extrap_table
 A structure for extrapolation for inte_qags_gsl. More...
- Public Attributes inherited from o2scl::inte< func_t >
int verbose
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 $ 10^{-8} $)
double tol_abs
 The maximum absolute uncertainty in the value of the integral (default $ 10^{-8} $)
bool err_nonconv
 If true, call the error handler if the routine does not converge or reach the desired tolerance (default true) More...

Detailed Description

template<class func_t = funct11>
class o2scl::inte_qaws_gsl< func_t >

This class computes the weighted integral

\[ \int_a^b f(x)(x - a)^\alpha (b - x)^\beta \log^\mu(x - a) \log^\nu(b - x)~dx \]

where the parameters of the weight function must satisfy

\[ \alpha > -1, \quad \beta > -1, \quad \mu \in \{0, 1\}, \quad \nu \in \{0, 1\}, \]

and which are set by set_weight(). Note that setting $ \mu=0 $ or $ \nu=0 $ removes the respective factor $ \log^mu(\ldots) $ or $ \log^\nu(\ldots) $ from the weight.

The adaptive refinement algorithm described for inte_qag_gsl is used. When a subinterval contains one of the endpoints, a special 25-point modified Clenshaw-Curtis rule is used to control the singularities. For subintervals which do not include the endpoints, a Gauss-Kronrod integration rule is used.

See GSL-based integration routines in the User's guide for general information about the GSL integration classes.

Definition at line 80 of file inte_qaws_gsl.h.

Constructor & Destructor Documentation

◆ inte_qaws_gsl()

template<class func_t = funct11>
o2scl::inte_qaws_gsl< func_t >::inte_qaws_gsl ( )

The default paramters $ \alpha, \beta, \mu, \nu $ of the weight function are all zero.

Definition at line 372 of file inte_qaws_gsl.h.

Member Function Documentation

◆ initialise_qaws_table()

template<class func_t = funct11>
void o2scl::inte_qaws_gsl< func_t >::initialise_qaws_table ( )

This is the function from the GSL source code integration/qmomo.c that initializes gsl_integration_qaws_table.

Definition at line 107 of file inte_qaws_gsl.h.

◆ set_weight()

template<class func_t = funct11>
int o2scl::inte_qaws_gsl< func_t >::set_weight ( double  u_alpha,
double  u_beta,
int  u_mu,
int  u_nu 

The parameters determine the exponents of the weight function

\[ W(x) = (x-a)^\alpha (b-x)^\beta \log^\mu(x-a) \log^\nu(b-x), \]

and must satsify

\[ \alpha > -1, \quad \beta > -1, \quad \mu \in \{0, 1\}, \quad \nu \in \{0, 1\}. \]

In order for the adaptive algorithm to run quickly, a table of Chebyshev weights for the particular parameters are computed in advance.

Definition at line 393 of file inte_qaws_gsl.h.

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

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