APFEL 4.8.0
A PDF evolution library in C++
Loading...
Searching...
No Matches
integrator.h
Go to the documentation of this file.
1//
2// APFEL++ 2017
3//
4// Author: Valerio Bertone: valerio.bertone@cern.ch
5//
6
7#pragma once
8
9#include <functional>
10#include <vector>
11
12namespace apfel
13{
19 {
20 public:
26
32
37 Integrator(std::function<double(double const&)> const& func, IntegrationMethod const& method = GAUSS_KRONROD);
38
47 double integrate(double const& xmin, double const& xmax, double const& eps) const;
48
59 double integrate(double const& xmin, double const& xmax, std::vector<double> const& FixPts, double const& eps) const;
60
75 double integrate(std::vector<double> const& FixPts, double const& eps) const;
76
87 double integrate(double const& xmin, double const& xmax, int const& n = 1) const;
88
101 double integrate(double const& xmin, double const& xmax, std::vector<double> const& FixPts, int const& n = 1) const;
102
117 double integrate(std::vector<double> const& FixPts, int const& n = 1) const;
118
124 double integrand(double const& x) const { return _func(x); };
125
129 IntegrationMethod Method() const { return _method; };
130
131 private:
140 std::pair<double, double> integrateGL(double const& xmin, double const& xmax) const;
141
150 std::pair<double, double> integrateGK(double const& xmin, double const& xmax) const;
151
161 double integrateGL(double const& xmin, double const& xmax, int const& n) const;
162
172 double integrateGK(double const& xmin, double const& xmax, int const& n) const;
173
174 private:
175 std::function<double(double const&)> const _func;
177 };
178}
The Integrator class performs unidimensional numerical integrations using the Guassian quadrature.
Definition integrator.h:19
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).
IntegrationMethod
Definition integrator.h:25
@ GAUSS_LEGENDRE
Definition integrator.h:25
@ GAUSS_KRONROD
Definition integrator.h:25
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 t...
std::function< double(double const &)> cons _func)
The integrand function.
Definition integrator.h:175
double integrand(double const &x) const
Function for the integrand.
Definition integrator.h:124
std::pair< double, double > integrateGK(double const &xmin, double const &xmax) const
Function that integrates the integrand using the Gauss-Kronrod method.
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 t...
IntegrationMethod const _method
The integration method.
Definition integrator.h:176
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).
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 t...
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 t...
Integrator(std::function< double(double const &)> const &func, IntegrationMethod const &method=GAUSS_KRONROD)
The Integrator constructor.
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...
std::pair< double, double > integrateGL(double const &xmin, double const &xmax) const
Function that integrates the integrand using the Gauss-Legendre method.
IntegrationMethod Method() const
Function that returns the integration method.
Definition integrator.h:129
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...
Namespace for all APFEL++ functions and classes.
Definition alphaqcd.h:14