limes 3.1.0
Composable Calculus Expressions for C++20
Loading...
Searching...
No Matches
integral.hpp File Reference

Fluent builder and node types for numerical integration. More...

#include <span>
#include <string>
#include <array>
#include <vector>
#include <cstddef>
#include <sstream>
#include <utility>
#include "../algorithms/integrators/integrators.hpp"
#include "../methods/methods.hpp"
#include "nodes/const.hpp"
#include "nodes/binary.hpp"
#include "box_integral.hpp"
+ Include dependency graph for integral.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  limes::expr::is_integral< Integral< E, Dim, Lo, Hi > >
 
struct  limes::expr::ConstBound< T >
 Constant integration bound (e.g., 0.0, 1.0) More...
 
struct  limes::expr::ExprBound< E >
 Expression-valued integration bound (depends on outer variables) More...
 
struct  limes::expr::Integral< E, Dim, Lo, Hi >
 Definite integral expression node. More...
 
struct  limes::expr::IntegralBuilder< E >
 Fluent builder for constructing integrals. More...
 
struct  limes::expr::TransformedIntegral< OriginalIntegral, Phi, Jacobian >
 Integral with change of variables (substitution). More...
 
struct  limes::expr::transforms::linear< T >
 Linear transform: x = a*t + b. More...
 
struct  limes::expr::transforms::linear_jacobian< T >
 Linear transform Jacobian: |dx/dt| = |a|. More...
 
struct  limes::expr::transforms::quadratic< T >
 Quadratic transform: x = t^2 (removes sqrt singularities at x=0) More...
 
struct  limes::expr::transforms::quadratic_jacobian< T >
 Quadratic transform Jacobian: |dx/dt| = 2|t|. More...
 

Namespaces

namespace  limes
 
namespace  limes::expr
 Expression layer for composable calculus.
 
namespace  limes::expr::detail
 
namespace  limes::expr::transforms
 

Functions

template<std::size_t Dim, typename E , typename T >
auto limes::expr::detail::make_integrand_fn (E const &integrand, std::span< T const > outer_args)
 
template<typename T >
requires std::is_arithmetic_v<T>
constexpr auto limes::expr::make_bound (T value)
 
template<typename E >
requires is_expr_node_v<E>
constexpr auto limes::expr::make_bound (E expr)
 
template<typename E >
requires is_expr_node_v<E>
constexpr auto limes::expr::integral (E expr)
 Create an IntegralBuilder for fluent integral construction.
 

Variables

template<typename T >
constexpr bool limes::expr::is_integral_v = is_integral<T>::value
 

Detailed Description

Fluent builder and node types for numerical integration.

This module provides the Integral expression node, IntegralBuilder for fluent construction, and related types like TransformedIntegral for change-of-variables.

Usage

using namespace limes::expr;
auto x = arg<0>;
// Basic integral: ∫₀¹ x² dx
auto I = integral(x*x).over<0>(0.0, 1.0);
auto result = I.eval(); // ≈ 0.333...
// With specific method
auto r2 = I.eval(gauss<7>());
// Nested integral: ∫₀¹ ∫₀¹ xy dx dy
auto y = arg<1>;
auto J = integral(integral(x*y).over<0>(0.0, 1.0)).over<1>(0.0, 1.0);
// Domain operations
auto [left, right] = I.split(0.5); // Split at x=0.5
// Change of variables (remove singularity)
auto K = integral(1.0/sqrt(x)).over<0>(0.0, 1.0);
auto T = K.transform(
[](double t) { return t*t; }, // x = t²
[](double t) { return 2*t; }, // dx/dt = 2t
0.0, 1.0 // new bounds
);
Expression layer for composable calculus.
Definition analysis.hpp:7
See also
IntegralBuilder Entry point via integral()
Integral Integration expression node
TransformedIntegral Change of variables

Definition in file integral.hpp.