limes 3.1.0
Composable Calculus Expressions for C++20
Loading...
Searching...
No Matches
limes::expr::IntegralBuilder< E > Struct Template Reference

Fluent builder for constructing integrals. More...

#include <integral.hpp>

Public Types

using value_type = typename E::value_type
 

Public Member Functions

constexpr IntegralBuilder (E e, value_type tol=value_type(1e-10)) noexcept
 
template<std::size_t Dim, typename Lo , typename Hi >
constexpr auto over (Lo lo, Hi hi) const
 
template<typename Lo , typename Hi >
constexpr auto over (std::size_t dim, Lo lo, Hi hi) const
 
constexpr IntegralBuilder with_tolerance (value_type tol) const
 
template<std::size_t Dims>
constexpr auto over_box (std::array< std::pair< value_type, value_type >, Dims > bounds) const
 
constexpr auto over_box (std::pair< value_type, value_type > b0, std::pair< value_type, value_type > b1) const
 
constexpr auto over_box (std::pair< value_type, value_type > b0, std::pair< value_type, value_type > b1, std::pair< value_type, value_type > b2) const
 

Public Attributes

expr
 
value_type tolerance
 

Detailed Description

template<typename E>
struct limes::expr::IntegralBuilder< E >

Fluent builder for constructing integrals.

IntegralBuilder wraps an expression and provides methods for specifying integration bounds. Use integral(expr) to create a builder.

Template Parameters
EThe integrand expression type
Usage
auto x = arg<0>;
// 1D integral
auto I = integral(x*x).over<0>(0.0, 1.0);
// Box integral (N-dimensional)
auto J = integral(x*y).over_box({{0,1}, {0,1}});
// With custom tolerance
auto K = integral(f).with_tolerance(1e-12).over<0>(0.0, 1.0);
constexpr auto integral(E expr)
Create an IntegralBuilder for fluent integral construction.
Definition integral.hpp:505
constexpr Var< 1, T > y
Definition var.hpp:49
constexpr Var< 0, T > x
Definition var.hpp:46
See also
integral() Entry point function
Integral The resulting integral node
BoxIntegral For N-dimensional box integration

Definition at line 424 of file integral.hpp.

Member Typedef Documentation

◆ value_type

template<typename E >
using limes::expr::IntegralBuilder< E >::value_type = typename E::value_type

Definition at line 425 of file integral.hpp.

Constructor & Destructor Documentation

◆ IntegralBuilder()

template<typename E >
constexpr limes::expr::IntegralBuilder< E >::IntegralBuilder ( e,
value_type  tol = value_type(1e-10) 
)
inlineconstexprnoexcept

Definition at line 430 of file integral.hpp.

Member Function Documentation

◆ over() [1/2]

template<typename E >
template<std::size_t Dim, typename Lo , typename Hi >
constexpr auto limes::expr::IntegralBuilder< E >::over ( Lo  lo,
Hi  hi 
) const
inlineconstexpr

◆ over() [2/2]

template<typename E >
template<typename Lo , typename Hi >
constexpr auto limes::expr::IntegralBuilder< E >::over ( std::size_t  dim,
Lo  lo,
Hi  hi 
) const
inlineconstexpr

Definition at line 444 of file integral.hpp.

◆ over_box() [1/3]

template<typename E >
template<std::size_t Dims>
constexpr auto limes::expr::IntegralBuilder< E >::over_box ( std::array< std::pair< value_type, value_type >, Dims >  bounds) const
inlineconstexpr

Definition at line 461 of file integral.hpp.

References limes::expr::IntegralBuilder< E >::expr.

◆ over_box() [2/3]

template<typename E >
constexpr auto limes::expr::IntegralBuilder< E >::over_box ( std::pair< value_type, value_type b0,
std::pair< value_type, value_type b1 
) const
inlineconstexpr

Definition at line 468 of file integral.hpp.

References limes::expr::IntegralBuilder< E >::expr.

◆ over_box() [3/3]

template<typename E >
constexpr auto limes::expr::IntegralBuilder< E >::over_box ( std::pair< value_type, value_type b0,
std::pair< value_type, value_type b1,
std::pair< value_type, value_type b2 
) const
inlineconstexpr

Definition at line 476 of file integral.hpp.

References limes::expr::IntegralBuilder< E >::expr.

◆ with_tolerance()

template<typename E >
constexpr IntegralBuilder limes::expr::IntegralBuilder< E >::with_tolerance ( value_type  tol) const
inlineconstexpr

Definition at line 455 of file integral.hpp.

References limes::expr::IntegralBuilder< E >::expr.

Member Data Documentation

◆ expr

◆ tolerance

template<typename E >
value_type limes::expr::IntegralBuilder< E >::tolerance

Definition at line 428 of file integral.hpp.

Referenced by limes::expr::IntegralBuilder< E >::over().


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