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

Classes

struct  extract_factor
 
struct  extract_factor< Binary< Mul, L, R >, TargetDim, OtherDim >
 For Binary<Mul, L, R>: extract the appropriate factor.
 
struct  extract_factor< Const< T >, TargetDim, OtherDim >
 For Const: return the constant (as factor 1 for the non-matching dimension)
 
struct  extract_factor< Unary< Op, E >, TargetDim, OtherDim >
 
struct  extract_factor< UnaryFunc< Tag, E >, TargetDim, OtherDim >
 
struct  extract_factor< Var< N, T >, TargetDim, OtherDim >
 For Var: return if it matches TargetDim, otherwise return Const<T>{1}.
 
struct  extract_single_child_factor
 
struct  integral_variable_set
 
struct  integral_variable_set< ProductIntegral< I1, I2 > >
 
struct  integral_variable_set< T, std::void_t< typename T::integrand_type > >
 
struct  is_separable_impl
 Primary template: not separable by default.
 
struct  is_separable_impl< Binary< Add, L, R >, D1, D2 >
 
struct  is_separable_impl< Binary< Mul, L, R >, D1, D2 >
 
struct  is_separable_impl< Binary< Sub, L, R >, D1, D2 >
 
struct  is_separable_impl< Const< T >, D1, D2 >
 Const<T>: Always separable (trivially, as g(x)*1 or 1*h(y))
 
struct  is_separable_impl< Unary< Op, E >, D1, D2 >
 
struct  is_separable_impl< UnaryFunc< Tag, E >, D1, D2 >
 
struct  is_separable_impl< Var< N, T >, D1, D2 >
 
struct  mc_box_sampler
 

Functions

template<typename E , std::size_t... Is>
auto derivative_dispatch_impl (E expr, std::size_t dim, std::index_sequence< Is... >)
 
template<typename E , std::size_t... Is>
constexpr auto gradient_impl (E expr, std::index_sequence< Is... >)
 
template<std::size_t Dim, typename E , typename T >
auto make_integrand_fn (E const &integrand, std::span< T const > outer_args)
 
template<typename Tag >
constexpr std::string_view tag_name ()
 
template<typename T >
std::vector< T > make_extended_args (std::span< T const > args, std::size_t index_dim)
 
template<typename E >
void pretty_print_impl (std::ostream &os, E const &expr, int indent)
 

Variables

template<typename E , std::uint64_t AllowedMask>
constexpr bool depends_only_on_v = (variable_set<E>::value & ~AllowedMask) == 0
 Helper to check if an expression depends only on certain dimensions.
 
template<typename E , std::size_t D1, std::size_t D2>
constexpr bool single_child_separable_v
 
template<typename T >
constexpr std::uint64_t integral_variable_set_v = integral_variable_set<T>::value
 

Function Documentation

◆ derivative_dispatch_impl()

template<typename E , std::size_t... Is>
auto limes::expr::detail::derivative_dispatch_impl ( expr,
std::size_t  dim,
std::index_sequence< Is... >   
)

Definition at line 65 of file derivative.hpp.

Referenced by limes::expr::derivative().

◆ gradient_impl()

template<typename E , std::size_t... Is>
constexpr auto limes::expr::detail::gradient_impl ( expr,
std::index_sequence< Is... >   
)
constexpr

Definition at line 96 of file derivative.hpp.

Referenced by limes::expr::gradient().

◆ make_extended_args()

template<typename T >
std::vector< T > limes::expr::detail::make_extended_args ( std::span< T const >  args,
std::size_t  index_dim 
)

◆ make_integrand_fn()

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 
)

Build a 1D function from an N-D integrand by fixing outer variables and varying only dimension Dim. Shared by Integral and TransformedIntegral.

Definition at line 82 of file integral.hpp.

References limes::expr::x.

◆ pretty_print_impl()

template<typename E >
void limes::expr::detail::pretty_print_impl ( std::ostream &  os,
E const &  expr,
int  indent 
)

Definition at line 21 of file to_string.hpp.

Referenced by limes::expr::pretty_print().

◆ tag_name()

template<typename Tag >
constexpr std::string_view limes::expr::detail::tag_name ( )
constexpr

Definition at line 35 of file primitives.hpp.

Variable Documentation

◆ depends_only_on_v

template<typename E , std::uint64_t AllowedMask>
constexpr bool limes::expr::detail::depends_only_on_v = (variable_set<E>::value & ~AllowedMask) == 0
inlineconstexpr

Helper to check if an expression depends only on certain dimensions.

Definition at line 142 of file analysis.hpp.

◆ integral_variable_set_v

template<typename T >
constexpr std::uint64_t limes::expr::detail::integral_variable_set_v = integral_variable_set<T>::value
inlineconstexpr

Definition at line 89 of file product_integral.hpp.

◆ single_child_separable_v

template<typename E , std::size_t D1, std::size_t D2>
constexpr bool limes::expr::detail::single_child_separable_v
inlineconstexpr
Initial value:
=
depends_only_on_v<E, (1ULL << D1)> || depends_only_on_v<E, (1ULL << D2)>
constexpr bool depends_only_on_v
Helper to check if an expression depends only on certain dimensions.
Definition analysis.hpp:142

Single-child expressions (Unary, UnaryFunc) are separable if they depend on at most one of D1 or D2

Definition at line 195 of file analysis.hpp.