65 template <
int Rank, u
int64_t StaticExtents, u
int64_t Str
ideOrder, layout_prop_e LayoutProp>
67 return sout <<
" Lengths : " << idxm.
lengths() <<
"\n"
68 <<
" Strides : " << idxm.
strides() <<
"\n"
69 <<
" StaticExtents : " <<
decode<Rank>(StaticExtents) <<
"\n"
71 <<
" Flags : " << LayoutProp <<
"\n";
94 if constexpr (A::rank == 1) {
96 auto const &len = a.indexmap().lengths();
97 for (
size_t i = 0; i < len[0]; ++i) sout << (i > 0 ?
"," :
"") << a(i);
102 if constexpr (A::rank == 2) {
103 auto const &len = a.indexmap().lengths();
105 for (
size_t i = 0; i < len[0]; ++i) {
106 sout << (i == 0 ?
"[" :
" [");
107 for (
size_t j = 0; j < len[1]; ++j) sout << (j > 0 ?
"," :
"") << a(i, j);
108 sout <<
"]" << (i == len[0] - 1 ?
"" :
"\n");
115 if constexpr (A::rank > 2) {
117 for (
bool first =
true;
auto &v : a) {
118 sout << (first ?
"" :
",") << v;
136 template <
int R,
typename F>
138 return sout <<
"array_adapter of shape " << aa.
shape();
143 template <
char OP, Array A>
146 template <
char OP, ArrayOrScalar L, ArrayOrScalar R>
159 template <
char OP, Array A>
161 return sout << OP << ex.
a;
174 template <
char OP, ArrayOrScalar L, ArrayOrScalar R>
176 return sout <<
"(" << ex.
l <<
" " << OP <<
" " << ex.
r <<
")";
187 template <
typename F,
typename... As>
189 return sout <<
"mapped";
Provides lazy expressions for nda::Array types.
Provides an array adapter class.
Adapter that consists of a shape and a callable object, which takes R integers as arguments (just lik...
auto const & shape() const
Get shape of the adapter.
Layout that specifies how to map multi-dimensional indices to a linear/flat index.
static constexpr std::array< int, Rank > stride_order
Decoded stride order.
std::array< long, Rank > const & lengths() const noexcept
Get the extents of all dimensions.
std::array< long, Rank > const & strides() const noexcept
Get the strides of all dimensions.
Provides concepts for the nda library.
constexpr bool is_regular_or_view_v
Constexpr variable that is true if type A is either a regular array or a view.
constexpr bool has_contiguous(layout_prop_e lp)
Checks if a layout property has the contiguous property.
constexpr bool has_strided_1d(layout_prop_e lp)
Checks if a layout property has the strided_1d property.
std::ostream & operator<<(std::ostream &os, range::all_t) noexcept
Write nda::range::all_t to a std::ostream as _.
constexpr bool has_smallest_stride_is_one(layout_prop_e lp)
Checks if a layout property has the smallest_stride_is_one property.
layout_prop_e
Compile-time guarantees of the memory layout of an array/view.
constexpr std::array< int, N > decode(uint64_t binary_representation)
Decode a uint64_t into a std::array<int, N>.
Provides a class that maps multi-dimensional indices to a linear index and vice versa.
Provides lazy function calls on arrays/views.
Provides utilities to work with permutations and to compactly encode/decode std::array objects.
A lazy function call expression on arrays/views.
Lazy unary expression for nda::Array types.
Lazy binary expression for nda::ArrayOrScalar types.
L l
nda::ArrayOrScalar left hand side operand.
R r
nda::ArrayOrScalar right hand side operand.
Provides type traits for the nda library.