Hex  1.0
Hydrogen-electron collision solver
 All Data Structures Namespaces Files Functions Variables Typedefs Macros Pages
Public Member Functions
ClenshawCurtis< Functor, FType > Class Template Reference

Clenshaw-Curtis quadrature. More...

#include <clenshawcurtis.h>

Public Member Functions

 ClenshawCurtis (Functor const &f)
 
double eps () const
 Get relative tolerance. More...
 
void setEps (double epsrel)
 Set relative tolerance. More...
 
double tol () const
 Get absolute tolerance. More...
 
void setTol (double epsabs)
 Set absolute tolerance. More...
 
double getRange () const
 Get compacification parameter. More...
 
void setRange (double l)
 Set compacification parameter. More...
 
int subdiv () const
 Get 2-log of maximal subdivision interval count. More...
 
void setSubdiv (int nlevel)
 Set 2-log of maximal subdivision interval count. More...
 
int stack () const
 Get subdivision level limit. More...
 
void setStack (int nlevel)
 Set subdivision level limit. More...
 
bool lim () const
 Get limit flag. More...
 
void setLim (bool limit)
 Set limit flag. More...
 
bool Rec () const
 Get recurrence flag. More...
 
void setRec (bool recurrence)
 Set recurrence flag. More...
 
bool verbose () const
 Get verbose flag. More...
 
void setVerbose (bool verbose, std::string name="ClenshawCurtis_ff")
 Set verbose flag. More...
 
void setThrowAll (bool t)
 Set warn flag. More...
 
bool throwall () const
 Get warn flag. More...
 
FType integrate (double x1, double x2, int *n=nullptr) const
 General integration. More...
 
FType integrate_ff (double x1, double x2, int *n=nullptr) const
 Finite integration. More...
 
FType integrate_ii (int *n=nullptr) const
 Improper integration. More...
 

Detailed Description

template<class Functor, typename FType>
class ClenshawCurtis< Functor, FType >

Clenshaw-Curtis integrator class. Constructor of the class accepts the function that will be integrated. The actual quadrature is done on the call to ClenshawCurtis::integrate. Clenshaw-Curtis quadrature evaluates the function in the Chebyshev nodes and uses sophisticated algorithm to extract the value of the quadrature. For more details see Numerical recipes (3rd ed.). The present implementation uses fast Fourier transform from FFTW for fast computation.

Constructor & Destructor Documentation

template<class Functor, typename FType>
ClenshawCurtis< Functor, FType >::ClenshawCurtis ( Functor const &  f)
inline

Constructor.

Parameters
fFunction to integrate of the signature FType(*)(double x).

Member Function Documentation

template<class Functor, typename FType>
double ClenshawCurtis< Functor, FType >::eps ( ) const
inline
template<class Functor, typename FType>
double ClenshawCurtis< Functor, FType >::getRange ( ) const
inline
template<class Functor, typename FType>
FType ClenshawCurtis< Functor, FType >::integrate ( double  x1,
double  x2,
int *  n = nullptr 
) const
inline

Clenshaw-Curtis quadrature, main interface.

Parameters
x1Left bound (allowed infinite).
x2Right bound (allowed infinite).
nOn input, maximal subdivision for a single bisection. (No effect for double infinite intervals.) On output, evaluations needed for converged result.
template<class Functor, typename FType>
FType ClenshawCurtis< Functor, FType >::integrate_ff ( double  x1,
double  x2,
int *  n = nullptr 
) const
inline

Clenshaw-Curtis quadrature for finite interval (a,b).

Parameters
x1Left bound (allowed infinite).
x2Right bound (allowed infinite).
nOn output, evaluations needed for a converged result.
template<class Functor, typename FType>
FType ClenshawCurtis< Functor, FType >::integrate_ii ( int *  n = nullptr) const
inline

Clenshaw-Curtis quadrature for infinite-infinite interval (-∞,+∞).

Parameters
nOn output, evaluations needed for converged result.
template<class Functor, typename FType>
bool ClenshawCurtis< Functor, FType >::lim ( ) const
inline
template<class Functor, typename FType>
bool ClenshawCurtis< Functor, FType >::Rec ( ) const
inline
template<class Functor, typename FType>
void ClenshawCurtis< Functor, FType >::setEps ( double  epsrel)
inline
template<class Functor, typename FType>
void ClenshawCurtis< Functor, FType >::setLim ( bool  limit)
inline
template<class Functor, typename FType>
void ClenshawCurtis< Functor, FType >::setRange ( double  l)
inline
template<class Functor, typename FType>
void ClenshawCurtis< Functor, FType >::setRec ( bool  recurrence)
inline
template<class Functor, typename FType>
void ClenshawCurtis< Functor, FType >::setStack ( int  nlevel)
inline
template<class Functor, typename FType>
void ClenshawCurtis< Functor, FType >::setSubdiv ( int  nlevel)
inline
template<class Functor, typename FType>
void ClenshawCurtis< Functor, FType >::setThrowAll ( bool  t)
inline
template<class Functor, typename FType>
void ClenshawCurtis< Functor, FType >::setTol ( double  epsabs)
inline
template<class Functor, typename FType>
void ClenshawCurtis< Functor, FType >::setVerbose ( bool  verbose,
std::string  name = "ClenshawCurtis_ff" 
)
inline
template<class Functor, typename FType>
int ClenshawCurtis< Functor, FType >::stack ( ) const
inline
template<class Functor, typename FType>
int ClenshawCurtis< Functor, FType >::subdiv ( ) const
inline
template<class Functor, typename FType>
bool ClenshawCurtis< Functor, FType >::throwall ( ) const
inline
template<class Functor, typename FType>
double ClenshawCurtis< Functor, FType >::tol ( ) const
inline
template<class Functor, typename FType>
bool ClenshawCurtis< Functor, FType >::verbose ( ) const
inline

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