38 template <
typename F,
typename D>
39 auto sum_f_domain_impl(F
const &f, D
const &d)
44 if (it == ite) NDA_RUNTIME_ERROR <<
"Error in nda::clef::sum_f_domain_impl: Sum over an empty domain";
47 for (; it != ite; ++it) res = res + f(*it);
75 template <
typename Expr,
int N,
typename D>
77 if constexpr (std::is_lvalue_reference_v<D>) {
108 template <
typename Expr,
typename D0,
typename D1,
typename... Ds>
109 auto sum(Expr
const &ex, D0 &&d0, D1 &&d1, Ds &&...ds) {
110 return sum(
sum(ex, std::forward<D0>(d0)), std::forward<D1>(d1), std::forward<Ds>(ds)...);
Provides basic functions to create and manipulate arrays and views.
Includes all relevant headers for the core clef library.
Provides a custom runtime error class and macros to assert conditions and throw exceptions.
decltype(auto) make_regular(A &&a)
Make a given object regular.
__inline__ auto make_function(T &&obj, Phs...)
Factory function for nda::clef::make_fun_impl objects.
#define CLEF_MAKE_FNT_LAZY(name)
Macro to make any function lazy, i.e. accept lazy arguments and return a function call expression nod...
decltype(auto) sum(Expr const &ex, clef::pair< N, D > d)
Sum an expression over a 1-dimensional domain.
constexpr bool is_clef_expression
Alias template for nda::clef::is_any_lazy.
A pair consisting of a placeholder and its assigned value.
T rhs
Value assigned to the placeholder (can be an lvalue reference).
A placeholder is an empty struct, labelled by an int.