44 template <
int R,
typename F>
46 static_assert(
CallableWithLongs<F, R>,
"Error in nda::array_adapter: Lambda should be callable with R integers");
49 std::array<long, R> myshape;
62 template <
typename Int>
69 [[nodiscard]]
auto const &
shape()
const {
return myshape; }
84 template <
typename... Ints>
86 static_assert((std::is_convertible_v<Ints, long> and ...),
"Error in nda::array_adapter: Arguments must be convertible to long");
92 template <auto R,
typename Int,
typename F>
93 array_adapter(std::array<Int, R>, F) -> array_adapter<R, F>;
101 template <
int R,
typename F>
Provides utility functions for std::array.
Adapter that consists of a shape and a callable object, which takes R integers as arguments (just lik...
array_adapter(std::array< Int, R > const &shape, F f)
Construct a new array adapter object.
auto operator()(long i0, Ints... is) const
Function call operator simply forwards the arguments to the callable object.
long size() const
Get the total size of the adapter.
auto const & shape() const
Get shape of the adapter.
Check if a given type can be called with a certain number of long arguments.
Provides concepts for the nda library.
constexpr char get_algebra
Constexpr variable that specifies the algebra of a type.
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.