![]() |
APFEL 4.8.0
A PDF evolution library in C++
|
The Integrator class performs unidimensional numerical integrations using the Guassian quadrature. More...
#include <integrator.h>
Public Types | |
Enumerator for the currently available integration | |
methods. | |
enum | IntegrationMethod : int { GAUSS_LEGENDRE , GAUSS_KRONROD } |
Constructors | |
List of constructors. | |
std::function< double(double const &)> const | _func |
The integrand function. | |
IntegrationMethod const | _method |
The integration method. | |
Integrator (std::function< double(double const &)> const &func, IntegrationMethod const &method=GAUSS_KRONROD) | |
The Integrator constructor. | |
double | integrate (double const &xmin, double const &xmax, double const &eps) const |
Function that integrates the integrand with a given relative accuracy using the method defined in the constructor. | |
double | integrate (double const &xmin, double const &xmax, std::vector< double > const &FixPts, double const &eps) const |
Function that integrates the integrand with a given relative accuracy using a set of fixed point on the integration range. | |
double | integrate (std::vector< double > const &FixPts, double const &eps) const |
Function that integrates the integrand with a given relative accuracy using a set of fixed point on the integration range. In this case, the vector also contains the lower and upper bounds. | |
double | integrate (double const &xmin, double const &xmax, int const &n=1) const |
Function that integrates the integrand with a given relative accuracy using the method defined in the constructor. | |
double | integrate (double const &xmin, double const &xmax, std::vector< double > const &FixPts, int const &n=1) const |
Function that integrates the integrand with a given relative accuracy using a set of fixed point on the integration range. | |
double | integrate (std::vector< double > const &FixPts, int const &n=1) const |
Function that integrates the integrand with a given relative accuracy using a set of fixed point on the integration range. In this case, the vector also contains the lower and upper bounds. | |
double | integrand (double const &x) const |
Function for the integrand. | |
IntegrationMethod | Method () const |
Function that returns the integration method. | |
std::pair< double, double > | integrateGL (double const &xmin, double const &xmax) const |
Function that integrates the integrand using the Gauss-Legendre method. | |
std::pair< double, double > | integrateGK (double const &xmin, double const &xmax) const |
Function that integrates the integrand using the Gauss-Kronrod method. | |
double | integrateGL (double const &xmin, double const &xmax, int const &n) const |
Function that integrates the integrand using the Gauss-Legendre method (no accuracy estimate). | |
double | integrateGK (double const &xmin, double const &xmax, int const &n) const |
Function that integrates the integrand using the Gauss-Kronrod method (no accuracy estimate). | |
The Integrator class performs unidimensional numerical integrations using the Guassian quadrature.
enum apfel::Integrator::IntegrationMethod : int |
apfel::Integrator::Integrator | ( | std::function< double(double const &)> const & | func, |
IntegrationMethod const & | method = GAUSS_KRONROD ) |
The Integrator constructor.
func | The function of one variable to be integrated |
method | The integration method to be used (default: GAUSS_KRONROD) |
|
inline |
Function for the integrand.
x | the integration variable |
double apfel::Integrator::integrate | ( | double const & | xmin, |
double const & | xmax, | ||
double const & | eps ) const |
Function that integrates the integrand with a given relative accuracy using the method defined in the constructor.
xmin | the lower bound integration bound |
xmax | the upper bound integration bound |
eps | the required relative accuracy |
double apfel::Integrator::integrate | ( | double const & | xmin, |
double const & | xmax, | ||
int const & | n = 1 ) const |
Function that integrates the integrand with a given relative accuracy using the method defined in the constructor.
xmin | the lower bound integration bound |
xmax | the upper bound integration bound |
n | index associated to the number of points used for the integration: 0 for 8/7 points for Gauss-Legendre/Kronrod, 1 for 16/15 points for Gauss-Legendre/Kronrod (default: 1) |
double apfel::Integrator::integrate | ( | double const & | xmin, |
double const & | xmax, | ||
std::vector< double > const & | FixPts, | ||
double const & | eps ) const |
Function that integrates the integrand with a given relative accuracy using a set of fixed point on the integration range.
xmin | the lower bound integration bound |
xmax | the upper bound integration bound |
FixPts | the vector of fixed points of the integration |
eps | the required relative accuracy |
double apfel::Integrator::integrate | ( | double const & | xmin, |
double const & | xmax, | ||
std::vector< double > const & | FixPts, | ||
int const & | n = 1 ) const |
Function that integrates the integrand with a given relative accuracy using a set of fixed point on the integration range.
xmin | the lower bound integration bound |
xmax | the upper bound integration bound |
FixPts | the vector of fixed points of the integration |
n | index associated to the number of points used for the integration: 0 for 8/7 points for Gauss-Legendre/Kronrod, 1 for 16/15 points for Gauss-Legendre/Kronrod (default: 1) |
double apfel::Integrator::integrate | ( | std::vector< double > const & | FixPts, |
double const & | eps ) const |
Function that integrates the integrand with a given relative accuracy using a set of fixed point on the integration range. In this case, the vector also contains the lower and upper bounds.
FixPts | the vector of fixed points of the integration |
eps | the required relative accuracy integration: 0 for 8/7 points for Gauss-Legendre/Kronrod, 1 for 16/15 points for Gauss-Legendre/Kronrod (default: 1) |
double apfel::Integrator::integrate | ( | std::vector< double > const & | FixPts, |
int const & | n = 1 ) const |
Function that integrates the integrand with a given relative accuracy using a set of fixed point on the integration range. In this case, the vector also contains the lower and upper bounds.
FixPts | the vector of fixed points of the integration |
n | index associated to the number of points used for the integration: 0 for 8/7 points for Gauss-Legendre/Kronrod, 1 for 16/15 points for Gauss-Legendre/Kronrod (default: 1) |
|
private |
Function that integrates the integrand using the Gauss-Kronrod method.
xmin | the lower bound integration bound |
xmax | the upper bound integration bound |
|
private |
Function that integrates the integrand using the Gauss-Kronrod method (no accuracy estimate).
xmin | the lower bound integration bound |
xmax | the upper bound integration bound |
n | index associated to the number of points used for the integration: 0 for 7 points for Gauss-Legendr, 1 for 15 points |
|
private |
Function that integrates the integrand using the Gauss-Legendre method.
xmin | the lower bound integration bound |
xmax | the upper bound integration bound |
|
private |
Function that integrates the integrand using the Gauss-Legendre method (no accuracy estimate).
xmin | the lower bound integration bound |
xmax | the upper bound integration bound |
n | index associated to the number of points used for the integration: 0 for 8 points for Gauss-Legendr, 1 for 16 points |
|
inline |
Function that returns the integration method.
|
private |
The integrand function.
|
private |
The integration method.