tfel
Loading...
Searching...
No Matches
tfel::math::GaussKronrodQuadrature Struct Reference

class implementing numerical integration using the Gauss-Kronrod's quadrature adaptative scheme. More...

#include </home/runner/work/tfel/tfel/include/TFEL/Math/NumericalIntegration/GaussKronrodQuadrature.hxx>

Classes

struct  NumericalParameters
 numerical parameters for the adaptative version More...

Public Types

template<ScalarConcept real, typename FunctionType>
using IntegralErrorType
 type of the estimate of the error on the integral, which has the unit of the integrand times the unit of the integration variable.
template<ScalarConcept real, typename FunctionType>
using AbsoluteToleranceType
 type of the absolute tolerance of the adaptative version, which bounds the error on the integral: the type of the error estimate when it is a quantity, the type of the integration variable otherwise.

Public Member Functions

template<ScalarConcept real, typename FunctionType>
constexpr auto operator() (const FunctionType &f, const real a, const real b, const NumericalParameters< AbsoluteToleranceType< real, FunctionType > > params) const noexcept(std::is_nothrow_invocable_v< FunctionType, real >) -> std::optional< tfel::math::result_type< real, std::invoke_result_t< FunctionType, real >, OpMult > > requires(std::is_invocable_v< FunctionType, real >)
template<ScalarConcept real, typename FunctionType>
constexpr auto operator() (const FunctionType &f, const real a, const real b) const noexcept(std::is_nothrow_invocable_v< FunctionType, real >) -> std::optional< std::tuple< tfel::math::result_type< real, std::invoke_result_t< FunctionType, real >, OpMult >, tfel::math::result_type< real, numeric_type< std::invoke_result_t< FunctionType, real > >, OpMult > > > requires(std::is_invocable_v< FunctionType, real >)
 integration of a function without refinement using 15pts Kronrod's quadrature rule. Error is estimated by comparison with 7pts Gauss' quadature rule.

Detailed Description

class implementing numerical integration using the Gauss-Kronrod's quadrature adaptative scheme.

This scheme is described in depth here: https://en.wikipedia.org/wiki/Gauss%E2%80%93Kronrod_quadrature_formula

Note
The implementation is strongly inspired by the one of the boost/math library

Member Typedef Documentation

◆ AbsoluteToleranceType

template<ScalarConcept real, typename FunctionType>
using tfel::math::GaussKronrodQuadrature::AbsoluteToleranceType
Initial value:
std::conditional_t<
real>
Definition Forward/qt.hxx:127
tfel::math::result_type< real, numeric_type< std::invoke_result_t< FunctionType, real > >, OpMult > IntegralErrorType
type of the estimate of the error on the integral, which has the unit of the integrand times the unit...
Definition GaussKronrodQuadrature.hxx:58

type of the absolute tolerance of the adaptative version, which bounds the error on the integral: the type of the error estimate when it is a quantity, the type of the integration variable otherwise.

◆ IntegralErrorType

template<ScalarConcept real, typename FunctionType>
using tfel::math::GaussKronrodQuadrature::IntegralErrorType
Initial value:
real,
OpMult>
std::conditional_t< tfel::typetraits::isScalar< std::decay_t< MathObjectType > >(), std::decay_t< MathObjectType >, typename MathObjectTraits< std::decay_t< MathObjectType > >::value_type > numeric_type
a simple alias
Definition MathObjectTraits.hxx:80
typename ResultType< A, B, Op >::type result_type
a simple alias
Definition ResultType.hxx:85

type of the estimate of the error on the integral, which has the unit of the integrand times the unit of the integration variable.

Member Function Documentation

◆ operator()() [1/2]

template<ScalarConcept real, typename FunctionType>
auto tfel::math::GaussKronrodQuadrature::operator() ( const FunctionType & f,
const real a,
const real b ) const->std::optional< std::tuple< tfel::math::result_type< real, std::invoke_result_t< FunctionType, real >, OpMult >, tfel::math::result_type< real, numeric_type< std::invoke_result_t< FunctionType, real > >, OpMult > > >requires(std::is_invocable_v< FunctionType, real >)
nodiscardconstexprnoexcept

integration of a function without refinement using 15pts Kronrod's quadrature rule. Error is estimated by comparison with 7pts Gauss' quadature rule.

Parameters
[in]ffunction to be integrated
[in]afirst bound
[in]bsecond bound
Returns
an optional tuple containing the value of the integral estimated using 15pts Kronrod's quadrature rule and an estimation of the quadrature error.

◆ operator()() [2/2]

template<ScalarConcept real, typename FunctionType>
auto tfel::math::GaussKronrodQuadrature::operator() ( const FunctionType & f,
const real a,
const real b,
const NumericalParameters< AbsoluteToleranceType< real, FunctionType > > params ) const->std::optional< tfel::math::result_type< real, std::invoke_result_t< FunctionType, real >, OpMult > >requires(std::is_invocable_v< FunctionType, real >)
nodiscardconstexprnoexcept
Parameters
[in]ffunction to be integrated
[in]afirst bound
[in]bsecond bound
[in]eexpected errors

The documentation for this struct was generated from the following files: