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

Numerical integrator. More...

#include <gausskronrod.h>

Inheritance diagram for GaussKronrod< Functor >:
Inheritance graph
[legend]
Collaboration diagram for GaussKronrod< Functor >:
Collaboration graph
[legend]

Public Member Functions

 GaussKronrod (Functor f, size_t limit=1000)
 
 ~GaussKronrod ()
 
double operator() (double x) const
 Evaluate the function. More...
 
bool integrate (double a, double b)
 Compute the integral. More...
 
bool ok () const
 
double result () const
 
double error () const
 
std::string const & status () const
 
void setEpsAbs (double epsabs)
 
void setEpsRel (double epsrel)
 
double epsabs () const
 
double epsrel () const
 

Static Public Member Functions

static double eval (double x, void *ptr_radf)
 Evaluates radial function supplied in a pointer. More...
 

Detailed Description

template<typename Functor>
class GaussKronrod< Functor >

The class is initialized by a lambda-function (= the integrand) and serves as a QuadPack wrapper. The member function integrate performs the actual integration. The getters result and abserr return the computed numbers.

For the initialization you will mostly want to use the structure

Constructor & Destructor Documentation

template<typename Functor>
GaussKronrod< Functor >::GaussKronrod ( Functor  f,
size_t  limit = 1000 
)
inline
template<typename Functor>
GaussKronrod< Functor >::~GaussKronrod ( )
inline

Member Function Documentation

template<typename Functor>
double GaussKronrod< Functor >::epsabs ( ) const
inline
template<typename Functor>
double GaussKronrod< Functor >::epsrel ( ) const
inline
template<typename Functor>
double GaussKronrod< Functor >::error ( ) const
inline
template<typename Functor>
static double GaussKronrod< Functor >::eval ( double  x,
void *  ptr_radf 
)
inlinestatic

This function serves as a workaround for impossibility of passing pointer-to-member to the GSL routines.

template<typename Functor>
bool GaussKronrod< Functor >::integrate ( double  a,
double  b 
)
inline

Performs the integration on a given interval. Uses specialized routines from GSL (that is, in this case, nothing than C-port of QuadPack).

You can compute improper integrals. For specifying "infinity" as one or both bounds use either

std::numeric_limits<double>::infinity()

for positive infinity or

-std::numeric_limits<double>::infinity()

for negative infinity.

Returns
The value of "Ok" (i.e. whether the last integration has been successful according to the library).
template<typename Functor>
bool GaussKronrod< Functor >::ok ( ) const
inline
template<typename Functor>
double GaussKronrod< Functor >::operator() ( double  x) const
inlinevirtual
template<typename Functor>
double GaussKronrod< Functor >::result ( ) const
inline
template<typename Functor>
void GaussKronrod< Functor >::setEpsAbs ( double  epsabs)
inline
template<typename Functor>
void GaussKronrod< Functor >::setEpsRel ( double  epsrel)
inline
template<typename Functor>
std::string const& GaussKronrod< Functor >::status ( ) const
inline

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