limes 3.1.0
Composable Calculus Expressions for C++20
Loading...
Searching...
No Matches
limes::methods Namespace Reference

Classes

struct  adaptive
 Adaptive integration with recursive interval subdivision until convergence. More...
 
struct  adaptive_composed
 Wraps any base method with adaptive interval subdivision until convergence. More...
 
struct  gauss_legendre
 N-point Gauss-Legendre quadrature, achieving degree 2N-1 polynomial exactness. More...
 
struct  is_integration_method
 Type trait to tag types as integration methods (specialized per method struct) More...
 
struct  is_integration_method< adaptive< T > >
 
struct  is_integration_method< adaptive_composed< M, T > >
 
struct  is_integration_method< gauss_legendre< N, T > >
 
struct  is_integration_method< monte_carlo< T > >
 
struct  is_integration_method< simpson< N, T > >
 
struct  is_integration_method< trapezoidal< N, T > >
 
struct  monte_carlo
 Monte Carlo integration using random sampling. Error decreases as O(1/sqrt(n)). More...
 
struct  simpson
 Simpson's 1/3 rule with N subdivisions (N must be even). Achieves O(h^4) convergence. More...
 
struct  trapezoidal
 Trapezoidal rule with N subdivisions. Achieves O(h^2) convergence. More...
 

Concepts

concept  IntegrationMethod
 A 1D integration method: callable with (function, lower, upper) returning integration_result.
 

Typedefs

template<typename T = double>
using default_method = adaptive< T >
 The default integration method (adaptive Gauss-Legendre)
 

Functions

template<std::size_t N, typename T = double>
constexpr auto gauss ()
 Factory for Gauss-Legendre quadrature.
 
template<typename T = double>
constexpr auto adaptive_method (T tol=T(1e-10))
 Factory for adaptive integration.
 
template<typename T = double>
constexpr auto monte_carlo_method (std::size_t n)
 Factory for Monte Carlo integration.
 
template<std::size_t N, typename T = double>
constexpr auto simpson_method ()
 Factory for Simpson's rule.
 
template<std::size_t N, typename T = double>
constexpr auto trapezoidal_method ()
 Factory for trapezoidal rule.
 
template<typename M , typename T = double>
constexpr auto make_adaptive (M base_method, T tol=T(1e-10))
 Factory for adaptive composition of any base method.
 

Variables

template<typename M >
constexpr bool is_integration_method_v = is_integration_method<M>::value
 

Typedef Documentation

◆ default_method

template<typename T = double>
using limes::methods::default_method = typedef adaptive<T>

The default integration method (adaptive Gauss-Legendre)

Definition at line 314 of file methods.hpp.

Function Documentation

◆ adaptive_method()

template<typename T = double>
constexpr auto limes::methods::adaptive_method ( tol = T(1e-10))
constexpr

Factory for adaptive integration.

Definition at line 97 of file methods.hpp.

◆ gauss()

template<std::size_t N, typename T = double>
constexpr auto limes::methods::gauss ( )
constexpr

Factory for Gauss-Legendre quadrature.

Definition at line 58 of file methods.hpp.

◆ make_adaptive()

template<typename M , typename T = double>
constexpr auto limes::methods::make_adaptive ( base_method,
tol = T(1e-10) 
)
constexpr

Factory for adaptive composition of any base method.

Definition at line 304 of file methods.hpp.

◆ monte_carlo_method()

template<typename T = double>
constexpr auto limes::methods::monte_carlo_method ( std::size_t  n)
constexpr

Factory for Monte Carlo integration.

Definition at line 162 of file methods.hpp.

◆ simpson_method()

template<std::size_t N, typename T = double>
constexpr auto limes::methods::simpson_method ( )
constexpr

Factory for Simpson's rule.

Definition at line 204 of file methods.hpp.

◆ trapezoidal_method()

template<std::size_t N, typename T = double>
constexpr auto limes::methods::trapezoidal_method ( )
constexpr

Factory for trapezoidal rule.

Definition at line 241 of file methods.hpp.

Variable Documentation

◆ is_integration_method_v

template<typename M >
constexpr bool limes::methods::is_integration_method_v = is_integration_method<M>::value
inlineconstexpr

Definition at line 20 of file concepts.hpp.