The Integrator2D class performs two-dimensional numerical integrations using the Guassian quadrature.
More...
#include <integrator2d.h>
|
List of constructors.
|
std::function< double(double const &, double const &)> const | _func |
| The integrand function.
|
|
Integrator::IntegrationMethod const | _method |
| The integration method.
|
|
| Integrator2D (std::function< double(double const &, double const &)> const &func, Integrator::IntegrationMethod const &method=Integrator::GAUSS_KRONROD) |
| The Integrator constructor.
|
|
double | integrate (double const &xmin, double const &xmax, double const &ymin, double const &ymax, double const &eps) const |
| Function that integrates the integrand with a given relative accuracy using the method defined in the constructor.
|
|
std::pair< double, double > | integrateGL (double const &xmin, double const &xmax, double const &ymin, double const &ymax) const |
| Function that integrates the integrand with a using the 8x8 and 16x16 Gauss-Legendre method.
|
|
std::pair< double, double > | integrateGK (double const &xmin, double const &xmax, double const &ymin, double const &ymax) const |
| Function that integrates the integrand with a using the 7x7 and 15x15 Gauss-Kronrod method.
|
|
double | integrand (double const &x, double const &y) const |
| Function for the integrand.
|
|
The Integrator2D class performs two-dimensional numerical integrations using the Guassian quadrature.
- Examples
- integrator_test.cc.
◆ Integrator2D()
The Integrator constructor.
- Parameters
-
func | The function of two variables to be integrated |
method | The integration method to be used (default: GAUSS_KRONROD) |
◆ integrand()
double apfel::Integrator2D::integrand |
( |
double const & | x, |
|
|
double const & | y ) const |
|
inline |
Function for the integrand.
- Parameters
-
x | the first variable |
y | the second variable |
- Returns
- the integrand evaluated at x and y
◆ integrate()
double apfel::Integrator2D::integrate |
( |
double const & | xmin, |
|
|
double const & | xmax, |
|
|
double const & | ymin, |
|
|
double const & | ymax, |
|
|
double const & | eps ) const |
Function that integrates the integrand with a given relative accuracy using the method defined in the constructor.
- Parameters
-
xmin | the lower bound integration bound for the first variable |
xmax | the upper bound integration bound for the first variable |
ymin | the lower bound integration bound for the second variable |
ymax | the upper bound integration bound for the second variable |
eps | the required relative accuracy |
- Returns
- the value of the integral
◆ integrateGK()
std::pair< double, double > apfel::Integrator2D::integrateGK |
( |
double const & | xmin, |
|
|
double const & | xmax, |
|
|
double const & | ymin, |
|
|
double const & | ymax ) const |
Function that integrates the integrand with a using the 7x7 and 15x15 Gauss-Kronrod method.
- Parameters
-
xmin | the lower bound integration bound for the first variable |
xmax | the upper bound integration bound for the first variable |
ymin | the lower bound integration bound for the second variable |
ymax | the upper bound integration bound for the second variable |
- Returns
- a pair containing the value of the integral computed with the 15x15 method and the relative difference w.r.t. the 7x7 one.
◆ integrateGL()
std::pair< double, double > apfel::Integrator2D::integrateGL |
( |
double const & | xmin, |
|
|
double const & | xmax, |
|
|
double const & | ymin, |
|
|
double const & | ymax ) const |
Function that integrates the integrand with a using the 8x8 and 16x16 Gauss-Legendre method.
- Parameters
-
xmin | the lower bound integration bound for the first variable |
xmax | the upper bound integration bound for the first variable |
ymin | the lower bound integration bound for the second variable |
ymax | the upper bound integration bound for the second variable |
- Returns
- a pair containing the value of the integral computed with the 16x16 method and the relative difference w.r.t. the 8x8 one.
◆ _func
std::function<double(double const&, double const&)> const apfel::Integrator2D::_func |
|
private |
◆ _method
The documentation for this class was generated from the following file: