37 template <
typename F, Array... A>
47 template <
typename... Char>
48 constexpr char _impl_find_common_algebra(
char x0, Char... x) {
49 return (((x == x0) && ...) ? x0 :
'N');
63 template <
typename F, Array... As>
89 template <
typename F,
Array... As>
95 std::tuple<
const As...>
a;
99 template <
size_t... Is,
typename... Args>
100 [[gnu::always_inline]] [[nodiscard]]
auto _call(std::index_sequence<Is...>, Args
const &...args)
const {
105 return f(std::get<Is>(
a)(args...)...);
110 template <
size_t... Is,
typename Arg>
111 [[gnu::always_inline]]
auto _call_bra(std::index_sequence<Is...>, Arg
const &arg)
const {
112 return f(std::get<Is>(
a)[arg]...);
128 template <
typename... Args>
130 return _call(std::make_index_sequence<
sizeof...(As)>{}, args...);
145 template <
typename Arg>
147 return _call_bra(std::make_index_sequence<
sizeof...(As)>{}, arg);
155 [[nodiscard]]
auto shape()
const {
return std::get<0>(
a).shape(); }
161 [[nodiscard]]
long size()
const {
return std::get<0>(
a).size(); }
184 EXPECTS(((as.shape() == a0.shape()) && ...));
185 return {
f, {std::forward<A0>(a0), std::forward<As>(as)...}};
214 return {std::move(f)};
Check if a given type satisfies the array concept.
Check if a given type is either an arithmetic or complex type.
Provides concepts for the nda library.
mapped< F > map(F f)
Create a lazy function call expression on arrays/views.
constexpr char get_algebra
Constexpr variable that specifies the algebra of a type.
constexpr bool is_range_or_ellipsis
Constexpr variable that is true if the type T is either an nda::range, an nda::range::all_t or an nda...
Macros used in the nda library.
Includes the itertools header and provides some additional utilities.
A lazy function call expression on arrays/views.
long size() const
Get the total size of the nda::Array objects.
auto shape() const
Get the shape of the nda::Array objects.
auto operator()(Args const &...args) const
Function call operator.
std::tuple< const As... > a
Tuple containing the nda::Array arguments.
F f
Callable object of the expression.
auto operator[](Arg const &arg) const
Subscript operator.
Functor that is returned by the nda::map function.
expr_call< F, A0, As... > operator()(A0 &&a0, As &&...as) const
Function call operator that returns a lazy function call expression.
auto operator()(T0 t0, Ts... ts) const
Function call operator that returns the result of the callable object applied to the scalar arguments...
Provides type traits for the nda library.