|
TRIQS/nda 1.3.0
Multi-dimensional array library for C++
|
Map multi-dimensional indices to a linear/flat index and vice versa and calculate the resulting memory layout when taking slices of already existing arrays/views.
Classes | |
| class | nda::idx_map< Rank, StaticExtents, StrideOrder, LayoutProp > |
| Layout that specifies how to map multi-dimensional indices to a linear/flat index. More... | |
Functions | |
| template<int R, uint64_t SE, uint64_t SO, layout_prop_e LP, typename... Args> | |
| __inline__ decltype(auto) | nda::slice_static::slice_idx_map (idx_map< R, SE, SO, LP > const &idxm, Args const &...args) |
| Determine the resulting nda::idx_map when taking a slice of a given nda::idx_map. | |
Variables | |
| template<int Rank> | |
| constexpr uint64_t | nda::C_stride_order = nda::encode(nda::permutations::identity<Rank>()) |
| C/Row-major stride order. | |
| template<int Rank> | |
| constexpr uint64_t | nda::Fortran_stride_order = nda::encode(nda::permutations::reverse_identity<Rank>()) |
| Fortran/Column-major stride order. | |
| __inline__ decltype(auto) nda::slice_static::slice_idx_map | ( | idx_map< R, SE, SO, LP > const & | idxm, |
| Args const &... | args ) |
#include <nda/layout/slice_static.hpp>
Determine the resulting nda::idx_map when taking a slice of a given nda::idx_map.
Let n_args be the number of given long, nda::range, nda::range::all_t or nda::ellipsis arguments.
The rank R' of the resulting slice is determined by the rank R of the original nda::idx_map and the number n_long of long arguments, i.e. R' = R - n_long.
The number of allowed nda::ellipsis objects is restricted to at most one. If an nda::ellipsis object is present and n_args <= R, the ellipsis is expanded in terms of nda::range::all_t objects to cover the remaining R - n_args + 1 dimensions. Otherwise, the ellipsis is ignored.
After ellipsis expansion, the only arguments contributing to the slice are nda::range and nda::range::all_t objects. Together with the original nda::idx_map, they determine the resulting nda::idx_map.
| R | Rank of the original nda::idx_map. |
| SE | Static extents of the original nda::idx_map. |
| SO | Stride order of the original nda::idx_map. |
| LP | Layout properties of the original nda::idx_map. |
| Args | Given argument types. |
| idxm | Original nda::idx_map. |
| args | Arguments consisting of long, nda::range, nda::range::all_t or nda::ellipsis objects. |
Definition at line 314 of file slice_static.hpp.
|
constexpr |
#include <nda/layout/idx_map.hpp>
C/Row-major stride order.
The last dimension varies the fastest, the first dimension the slowest.
| Rank | Number of dimensions. |
Definition at line 52 of file idx_map.hpp.
|
constexpr |
#include <nda/layout/idx_map.hpp>
Fortran/Column-major stride order.
The first dimension varies the fastest, the last dimension the slowest.
| Rank | Number of dimensions. |
Definition at line 44 of file idx_map.hpp.