25#ifndef quantlib_gaussian_quadratures_hpp
26#define quantlib_gaussian_quadratures_hpp
33 class GaussianOrthogonalPolynomial;
53#if defined(__GNUC__) && (__GNUC__ >= 7)
54#pragma GCC diagnostic push
55#pragma GCC diagnostic ignored "-Wnoexcept-type"
62 sum +=
w_[i] *
f(
x_[i]);
67#if defined(__GNUC__) && (__GNUC__ >= 7)
68#pragma GCC diagnostic pop
213 template <
class Integration>
223 Real b)
const override;
252 QL_ASSERT((
n_>0),
"assume at least 1 point in quadrature");
253 val =
w_[0]*
f(
x_[0]);
260 for (
Size i=startIdx; i<
n_; ++i) {
261 val +=
w_[i]*
f(
x_[i]);
262 val +=
w_[i]*
f(-
x_[i]);
1-D array used in linear algebra.
1-D array used in linear algebra.
Size size() const
dimension of the array
Gauss-Chebyshev integration (second kind)
GaussChebyshev2ndIntegration(Size n)
Gauss-Chebyshev integration.
GaussChebyshevIntegration(Size n)
Gauss-Gegenbauer integration.
GaussGegenbauerIntegration(Size n, Real lambda)
generalized Gauss-Hermite integration
GaussHermiteIntegration(Size n, Real mu=0.0)
Gauss-Hermite polynomial.
Gauss-Hyperbolic integration.
GaussHyperbolicIntegration(Size n)
Gauss hyperbolic polynomial.
Gauss-Jacobi integration.
GaussJacobiIntegration(Size n, Real alpha, Real beta)
generalized Gauss-Laguerre integration
GaussLaguerreIntegration(Size n, Real s=0.0)
Gauss-Laguerre polynomial.
Gauss-Legendre integration.
GaussLegendreIntegration(Size n)
orthogonal polynomial for Gaussian quadratures
Integral of a 1-dimensional function using the Gauss quadratures method.
Real operator()(const F &f) const
tabulated Gauss-Legendre quadratures
TabulatedGaussLegendre(Size n=20)
Real operator()(const F &f) const
static const Real x20[10]
static const Real w20[10]
Real integrate(const ext::function< Real(Real)> &f, Real a, Real b) const override
const ext::shared_ptr< Integration > integration_
ext::shared_ptr< Integration > getIntegration() const
#define QL_ASSERT(condition, message)
throw an error if the given condition is not verified
ext::function< Real(Real)> b
orthogonal polynomials for gaussian quadratures
QL_INTEGER Integer
integer number
std::size_t Size
size of a container
Integrators base class definition.
detail::GaussianQuadratureIntegrator< GaussChebyshevIntegration > GaussChebyshevIntegrator
detail::GaussianQuadratureIntegrator< GaussChebyshev2ndIntegration > GaussChebyshev2ndIntegrator
detail::GaussianQuadratureIntegrator< GaussLegendreIntegration > GaussLegendreIntegrator