TRIQS/nda 1.3.0
Multi-dimensional array library for C++
Loading...
Searching...
No Matches
Memory layout

Detailed Description

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 some "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 but possibly quite 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, looping over multi-dimensional indices, structs that mimic Python's : and ... syntax and more.
 
 Multi-dimensional indexing
 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.