TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
triqs::experimental::utility::integrate_1d_adapt< T >

#include <triqs/experimental/utility/adaptive.hpp>

Detailed Description

template<typename T>
class triqs::experimental::utility::integrate_1d_adapt< T >

Adaptive one-dimensional integrator based on a 13-point Gauss-Kronrod-Lobatto rule.

This class integrates a callable \( f(x) \) over a one-dimensional interval \( [a, b] \) by recursively subdividing the domain. On each subinterval it compares a 4-point Gauss-Lobatto estimate with a 7-point Kronrod estimate and keeps subdividing until their difference falls below the requested relative tolerance (scaled by a global 13-point Kronrod estimate of the integral).

It supports both scalar- and array-valued integrands and can be combined with CLEF lazy expressions through triqs::experimental::utility::integrate.

Template Parameters
TValue type of the integrand, either a scalar type or an array type.

Definition at line 31 of file adaptive.hpp.

Public Member Functions

 integrate_1d_adapt (double tolerance=1e-6)
 Construct an adaptive one-dimensional integrator with the given relative tolerance.
auto operator() (auto const &f, const std::pair< double, double > &domain) const
 Perform the adaptive one-dimensional integration of a callable integrand over a given domain.
auto operator() (auto f, const std::pair< double, double > &domain) const
 Build a lazy CLEF call expression for the integral of a lazy integrand over a given domain.

Constructor & Destructor Documentation

◆ integrate_1d_adapt()

template<typename T>
triqs::experimental::utility::integrate_1d_adapt< T >::integrate_1d_adapt ( double tolerance = 1e-6)
inline

Construct an adaptive one-dimensional integrator with the given relative tolerance.

Parameters
toleranceRelative tolerance at which the recursive subdivision is stopped.

Definition at line 54 of file adaptive.hpp.

Member Function Documentation

◆ operator()() [1/2]

template<typename T>
auto triqs::experimental::utility::integrate_1d_adapt< T >::operator() ( auto const & f,
const std::pair< double, double > & domain ) const
inline

Perform the adaptive one-dimensional integration of a callable integrand over a given domain.

This overload is selected when the integrand is a plain callable (not a CLEF lazy expression). It evaluates a 13-point Kronrod estimate to set the error scale and then drives the recursive subdivision.

Parameters
fCallable integrand \( f(x) \).
domainPair \( (a, b) \) giving the start and end points of the integration interval.
Returns
Value of the integral \( \int_a^b f(x) \, dx \).

Definition at line 82 of file adaptive.hpp.

◆ operator()() [2/2]

template<typename T>
auto triqs::experimental::utility::integrate_1d_adapt< T >::operator() ( auto f,
const std::pair< double, double > & domain ) const
inline

Build a lazy CLEF call expression for the integral of a lazy integrand over a given domain.

This overload is selected when the integrand is a CLEF lazy expression. It defers the evaluation by returning a CLEF call expression that integrates the expression once its placeholders are assigned.

Parameters
fLazy CLEF expression representing the integrand \( f(x) \).
domainPair \( (a, b) \) giving the start and end points of the integration interval.
Returns
Lazy CLEF call expression representing the integral of \( f \) over the domain.

Definition at line 66 of file adaptive.hpp.


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