Classes | Public Types | Protected Member Functions | List of all members
o2scl::inte_singular_gsl< func_t > Class Template Reference

Base class for integrating a function with a singularity (GSL) More...

#include <inte_singular_gsl.h>

Inheritance diagram for o2scl::inte_singular_gsl< func_t >:
o2scl::inte_kronrod_gsl< func_t > o2scl::inte_gsl o2scl::inte< func_t > o2scl::inte_qags_gsl< func_t > o2scl::inte_transform_gsl< func_t > o2scl::inte_cheb_gsl< func_t > o2scl::inte_qagi_gsl< func_t > o2scl::inte_qagil_gsl< func_t > o2scl::inte_qagiu_gsl< func_t > o2scl::inte_qawc_gsl< func_t > o2scl::inte_qawo_gsl_sin< func_t > o2scl::inte_qaws_gsl< func_t > o2scl::inte_qawf_gsl_sin< func_t > o2scl::inte_qawo_gsl_cos< func_t > o2scl::inte_qawf_gsl_cos< func_t >

Classes

struct  extrapolation_table
 A structure for extrapolation for inte_qags_gsl. More...
 

Public Types

typedef struct o2scl::inte_singular_gsl::extrapolation_table extrap_table
 A structure for extrapolation for inte_qags_gsl. More...
 

Protected Member Functions

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...
 

Additional Inherited Members

- 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...
 
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.
 
- 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.
 
virtual int integ_err (func_t &func, double a, double b, double &res, double &err)=0
 Integrate function func from a to b and place the result in res and the error in err.
 
double get_error ()
 Return the numerically estimated error in the result from the last call to integ() More...
 
virtual const char * type ()
 Return string denoting type ("inte")
 
- Public Attributes inherited from o2scl::inte< func_t >
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 $ 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...
 
- Protected Attributes inherited from o2scl::inte_kronrod_gsl< func_t >
inte_workspace_gslw
 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.
 

Detailed Description

template<class func_t>
class o2scl::inte_singular_gsl< func_t >

This class contains the extrapolation table mechanics and the base integration function for singular integrals from GSL. The casual end-user should use the classes explained in the Integration section of the User's guide.

Idea for Future:
Some of the functions inside this class could be moved out of header files?

Definition at line 53 of file inte_singular_gsl.h.

Member Typedef Documentation

◆ extrap_table

Idea for Future:
Move this to a new class, with qelg() as a method

Member Function Documentation

◆ qags()

template<class func_t>
int o2scl::inte_singular_gsl< func_t >::qags ( func_t &  func,
const double  a,
const double  b,
const double  l_epsabs,
const double  l_epsrel,
double *  result,
double *  abserr 
)
inlineprotected
Idea for Future:
Remove goto statements. Before this is done, it might be best to add some tests which fail in the various ways.

Definition at line 348 of file inte_singular_gsl.h.

◆ qelg()

template<class func_t>
void o2scl::inte_singular_gsl< func_t >::qelg ( struct extrapolation_table table,
double *  result,
double *  abserr 
)
inlineprotected

For certain convergent series $ \sum_k a_k $ whose error term $ E_n = \sum_{k=n}^\infty a_k $ is well behaved, it is possible to find a transformation of the sequence that yields a faster converging series to the same limit. This method of extrapolation applies to some sequences of adaptive-approximation and error-estimation for numerical integration. This function implements the $ \varepsilon$-algorithm (Wynn56, Piessens83) for an extrapolation table stored in table.

Quadpack documentation

c
c   list of major variables
c   -----------------------
c   e0     - the 4 elements on which the computation of a new
c   e1       element in the epsilon table is based
c   e2
c   e3                 e0
c                e3    e1    new
c                      e2
c   newelm - number of elements to be computed in the new
c            diagonal
c   error  - error = abs(e1-e0)+abs(e2-e1)+abs(new-e2)
c   result - the element in the new diagonal with least value
c            of error
c
c   machine dependent constants
c   ---------------------------
c
c   epmach is the largest relative spacing.
c   oflow is the largest positive magnitude.
c   limexp is the maximum number of elements the epsilon
c   table can contain. if this number is reached, the upper
c   diagonal of the epsilon table is deleted.
c

Definition at line 140 of file inte_singular_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).