limes 3.1.0
Composable Calculus Expressions for C++20
Loading...
Searching...
No Matches
limes::expr::ProductIntegral< I1, I2 > Struct Template Reference

Product of two independent integrals. More...

#include <product_integral.hpp>

Public Types

using value_type = typename I1::value_type
 

Public Member Functions

constexpr ProductIntegral (I1 i1, I2 i2) noexcept
 
algorithms::integration_result< value_typeeval () const
 Evaluate the product integral (no outer arguments)
 
template<typename... Args>
algorithms::integration_result< value_typeeval (Args &&... args) const
 Evaluate with arguments (for integrals with free variables)
 
std::string to_string () const
 String representation.
 
template<typename I3 >
constexpr auto operator* (I3 const &other) const
 Multiply with another integral (chaining)
 

Public Attributes

I1 left
 
I2 right
 

Detailed Description

template<typename I1, typename I2>
struct limes::expr::ProductIntegral< I1, I2 >

Product of two independent integrals.

For integrals over independent variables:

\[
  \left(\int f(x) \, dx\right) \cdot \left(\int g(y) \, dy\right)
\]

The product can be computed by evaluating each integral separately and multiplying the results, which is much faster than nested integration.

Template Parameters
I1First integral type
I2Second integral type
Independence Requirement
The two integrals must depend on disjoint variable sets. This is verified at compile time using variable_set analysis. If the integrals share variables, a static_assert fires with a descriptive error message.
Error Propagation
Errors are propagated using the product rule:

\[
  \delta(ab) = |b|\delta a + |a|\delta b
\]

Example
auto x = arg<0>;
auto y = arg<1>;
auto I = integral(sin(x)).over<0>(0.0, pi);
auto J = integral(exp(y)).over<1>(0.0, 1.0);
auto IJ = I * J;
auto result = IJ.eval(); // Evaluates I and J separately
constexpr auto integral(E expr)
Create an IntegralBuilder for fluent integral construction.
Definition integral.hpp:505
constexpr auto sin(E e)
constexpr Var< 1, T > y
Definition var.hpp:49
constexpr auto exp(E e)
constexpr Var< 0, T > x
Definition var.hpp:46
See also
operator*(I1, I2) Factory operator
product() Variadic factory function

Definition at line 138 of file product_integral.hpp.

Member Typedef Documentation

◆ value_type

template<typename I1 , typename I2 >
using limes::expr::ProductIntegral< I1, I2 >::value_type = typename I1::value_type

Definition at line 139 of file product_integral.hpp.

Constructor & Destructor Documentation

◆ ProductIntegral()

template<typename I1 , typename I2 >
constexpr limes::expr::ProductIntegral< I1, I2 >::ProductIntegral ( I1  i1,
I2  i2 
)
inlineconstexprnoexcept

Definition at line 152 of file product_integral.hpp.

Member Function Documentation

◆ eval() [1/2]

template<typename I1 , typename I2 >
algorithms::integration_result< value_type > limes::expr::ProductIntegral< I1, I2 >::eval ( ) const
inline

Evaluate the product integral (no outer arguments)

Definition at line 157 of file product_integral.hpp.

References limes::expr::ProductIntegral< I1, I2 >::left, and limes::expr::ProductIntegral< I1, I2 >::right.

◆ eval() [2/2]

template<typename I1 , typename I2 >
template<typename... Args>
algorithms::integration_result< value_type > limes::expr::ProductIntegral< I1, I2 >::eval ( Args &&...  args) const
inline

Evaluate with arguments (for integrals with free variables)

Definition at line 164 of file product_integral.hpp.

References limes::expr::ProductIntegral< I1, I2 >::left, and limes::expr::ProductIntegral< I1, I2 >::right.

◆ operator*()

template<typename I1 , typename I2 >
template<typename I3 >
constexpr auto limes::expr::ProductIntegral< I1, I2 >::operator* ( I3 const &  other) const
inlineconstexpr

Multiply with another integral (chaining)

Definition at line 193 of file product_integral.hpp.

◆ to_string()

template<typename I1 , typename I2 >
std::string limes::expr::ProductIntegral< I1, I2 >::to_string ( ) const
inline

Member Data Documentation

◆ left

◆ right


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