Clenshaw-Curtis quadrature.
More...
#include <clenshawcurtis.h>
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.
template<class Functor, typename FType>
Constructor.
- Parameters
-
f | Function to integrate of the signature FType(*)(double x). |
template<class Functor, typename FType>
template<class Functor, typename FType>
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
-
x1 | Left bound (allowed infinite). |
x2 | Right bound (allowed infinite). |
n | On 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
-
x1 | Left bound (allowed infinite). |
x2 | Right bound (allowed infinite). |
n | On 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
-
n | On output, evaluations needed for converged result. |
template<class Functor, typename FType>
template<class Functor, typename FType>
template<class Functor, typename FType>
template<class Functor, typename FType>
template<class Functor, typename FType>
template<class Functor, typename FType>
template<class Functor, typename FType>
template<class Functor, typename FType>
template<class Functor, typename FType>
template<class Functor, typename FType>
template<class Functor, typename FType>
void ClenshawCurtis< Functor, FType >::setVerbose |
( |
bool |
verbose, |
|
|
std::string |
name = "ClenshawCurtis_ff" |
|
) |
| |
|
inline |
template<class Functor, typename FType>
template<class Functor, typename FType>
template<class Functor, typename FType>
template<class Functor, typename FType>
template<class Functor, typename FType>
The documentation for this class was generated from the following file: