|
TRIQS/nda 2.0.0
Multi-dimensional array library for C++
|
Different memory layouts and tools to access specific data in a block of memory.
Under the hood, a multi-dimensional array (an nda::basic_array) or view (an nda::basic_array_view) is just a 1-dimensional block of contiguous memory. It only gets its multi-dimensional character because we choose to interpret the memory in a certain way. By interpreting the same block of memory in another way, we get a new, possibly very different array/view. To be consistent, it is therefore important to specify exactly how the elements of an array/view are laid out in memory.
Once the layout has been specified, we need tools that allow us to access single elements or more complicated parts of an array/view (slices). That means we need to map multi-dimensional indices to a linear/flat index and vice versa.
Topics | |
| Layout policies | |
| Various layout policies that can be used with nda::basic_array and nda::basic_array_view. | |
| Layout utilities | |
| Enums, type traits, bounds checking, multi-dimensional index iteration, and helpers that mimic Python's : and ... slicing syntax. | |
| Multi-dimensional indexing | |
| Mapping between multi-dimensional and linear/flat indices, and calculation of the resulting memory layout when taking slices of existing arrays/views. | |