Classes | Functions

Multidimensional Arrays with Flexible Data Layout and On-Demand Slice Creation

Multidimensional arrays are defined via recursive templates. More...

Classes

Functions


Detailed Description

Multidimensional arrays are defined via recursive templates.

Multi-valued homogeneous value types of constant size (e.g. float [4]) are supported transparently in different layouts. In this context, we call the value type the "fiber type". The fiber type may be a native scalar, such as float, double, int..., or e.g. constructed from a FixedArray<4,double>. Fiber types built from the FixedArray<> are specifically supported such that they may be stored in memory as separated compound ("XXXXXXYYYYYYZZZZZZ") as well as contiguous. ("XYZXYZXYZXYZXYZXYZ"). In both cases, the element access operate yields a reference to a XYZ variable. Also, in each layout a multidimensional array referring to only one component can be retrieved.

Subdimensional arrays (nD -> n-1 D) can be retrieved through the slice() function. The data are shared and the same memory layout as from the source array is sustained. At this occasion the subslice may also be created, e.g. procedurally or by loading data from disk or remotely.