APFEL 4.8.0
A PDF evolution library in C++
Loading...
Searching...
No Matches
List of all members
apfel::Integrator2D Class Reference

The Integrator2D class performs two-dimensional numerical integrations using the Guassian quadrature. More...

#include <integrator2d.h>

Constructors

List of constructors.

std::function< double(double const &, double const &)> cons _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.
 

Detailed Description

The Integrator2D class performs two-dimensional numerical integrations using the Guassian quadrature.

Examples
integrator_test.cc.

Constructor & Destructor Documentation

◆ Integrator2D()

apfel::Integrator2D::Integrator2D ( std::function< double(double const &, double const &)> const & func,
Integrator::IntegrationMethod const & method = Integrator::GAUSS_KRONROD )

The Integrator constructor.

Parameters
funcThe function of two variables to be integrated
methodThe integration method to be used (default: GAUSS_KRONROD)

Member Function Documentation

◆ integrand()

double apfel::Integrator2D::integrand ( double const & x,
double const & y ) const
inline

Function for the integrand.

Parameters
xthe first variable
ythe 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
xminthe lower bound integration bound for the first variable
xmaxthe upper bound integration bound for the first variable
yminthe lower bound integration bound for the second variable
ymaxthe upper bound integration bound for the second variable
epsthe 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
xminthe lower bound integration bound for the first variable
xmaxthe upper bound integration bound for the first variable
yminthe lower bound integration bound for the second variable
ymaxthe 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
xminthe lower bound integration bound for the first variable
xmaxthe upper bound integration bound for the first variable
yminthe lower bound integration bound for the second variable
ymaxthe 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.

Member Data Documentation

◆ _func

std::function<double(double const&, double const&)> cons apfel::Integrator2D::_func)
private

The integrand function.

◆ _method

Integrator::IntegrationMethod const apfel::Integrator2D::_method
private

The integration method.


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