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

Adaptive integration for oscillatory integrals (GSL) More...

#include <inte_qawf_gsl.h>

Inheritance diagram for o2scl::inte_qawf_gsl_sin< func_t >:
o2scl::inte_qawo_gsl_sin< 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 > o2scl::inte_qawf_gsl_cos< func_t >

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

int qawf (func_t &func, const double a, const double epsabs, double *result, double *abserr)
 The full GSL integration routine called by integ_err()
 
virtual double transform (double t, func_t &func)
 Add the oscillating part to the integrand.
 
const char * type ()
 Return string denoting type ("inte_qawf_gsl_sin")
 
- Protected Member Functions inherited from o2scl::inte_qawo_gsl_sin< func_t >
int qawo (func_t &func, const double a, const double epsabs, const double epsrel, inte_workspace_gsl *loc_w, gsl_integration_qawo_table *wf, double *result, double *abserr)
 The full GSL integration routine called by integ_err() More...
 
void qc25f (func_t &func, double a, double b, gsl_integration_qawo_table *wf, size_t level, double *result, double *abserr, double *resabs, double *resasc)
 25-point quadrature for oscillating functions
 
const char * type ()
 Return string denoting type ("inte_qawo_gsl_sin")
 
- 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

inte_workspace_gslcyclew
 The integration workspace.
 
- Protected Attributes inherited from o2scl::inte_qawo_gsl_sin< func_t >
gsl_integration_qawo_table * otable
 The integration workspace.
 
- 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.
 

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_qawo_gsl_sin< func_t >
double omega
 The user-specified frequency (default 1.0)
 
size_t n_levels
 The number of bisection levels (default 10)
 
- 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...
 

Detailed Description

template<class func_t>
class o2scl::inte_qawf_gsl_sin< func_t >

The Fourier integral

\[ \int_a^{\infty} f(x) \sin(\omega x)~dx \]

is computed for some frequency parameter $ \omega $, stored in inte_qawo_gsl_sin::omega .

The integral is computed using the same method as inte_qawo_gsl_sin and inte_qawo_gsl_cos over each of the subintervals,

\begin{eqnarray*} C_1 &=& [a, a+c] \\ C_2 &=& [a+c, a+2c] \\ &\vdots & \\ C_k &=& [a +(k-1)c,\, a+kc], \end{eqnarray*}

where $ c = (2\mathrm{floor}(|\omega|)+1)\pi/|\omega|$. This width is chosen to cover an odd number of periods so that the contributions from the intervals alternate in sign and are monotonically decreasing when $ f $ is positive and monotonically decreasing. The sum of this sequence of contributions is accelerated using the $ \varepsilon $ algorithm.

The algorithm uses zero for the relative tolerance inte::tol_rel and attempts to compute the integral to an overall absolute tolerance set by inte::tol_abs. The following strategy is used: on each interval $ C_k$, the algorithm tries to achieve the tolerance

\[ \mathrm{TOL}_k = u_k\cdot \epsilon_{\mathrm{abs}} \]

where $ u_k = (1-p)p^{k-1} $ and $ p = 0.9$. The sum of the geometric series of contributions from each interval gives an overall tolerance of $ \epsilon_{\mathrm{abs}}$. If the integration of a subinterval leads to difficulties then the accu racy requirement for subsequent intervals is relaxed,

\[ \mathrm{TOL}_k = u_k\cdot \max\{\epsilon_{\mathrm{abs}}, E_1, \ldots, E_{k-1} \} \]

where $ E_k$ is the estimated error on the interval $ C_k$.

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

When verbose output is enabled, this class outputs information from both the subintegrations performed by inte_qawo_gsl_sin and the overall integration progress in this class.

Todo:
More documentation and examples for the qawf, qawo and qawc integrators.

Definition at line 95 of file inte_qawf_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).