Multidimensional arrays are defined via recursive templates.
More...
Classes
Functions
-
template<class Dest , class Source , class Converter > void Fiber::ExtractSlice2D (MultiArray< 2, Dest > &DestArray, const MultiArray< 3, Source > &SrcArray, const SliceSelection &O, const index_t &SliceNumber, const Converter &C)
- Extract data slice from the source array to the destination array, whereby the destination array must be larger than or equal to the source array.
-
template<class Dest , class Source , int N, class Converter > void Fiber::Copy (MultiArray< N, Dest > &DestArray, const MultiArray< N, Source > &SrcArray, const Converter &C)
- Copy data from the source array to the destination array, whereby the destination array must be larger than or equal to the source array.
-
template<class Dest , class Source , int N, class Converter > void Fiber::Copy (MultiArray< N, Dest > &DestArray, const MultiIndex< N > &DestOffset, const MultiArray< N, Source > &SrcArray, const Converter &C)
- Copy data from the source array to the destination array, whereby the destination array must be larger than or equal to the source array.
-
template<class Dest , class Source , int N, class Converter > void Fiber::Copy (MultiArray< N, Dest > &DestArray, const MultiArray< N, Source > &SrcArray, const MultiIndex< N > &SrcOffset, const Converter &C)
- Copy data from the source array to the destination array, whereby the destination array must be larger than or equal to the source array.
-
template<class Dest , class Source , int N, class Converter > void Fiber::Copy (MultiArray< N, Dest > &DestArray, const MultiIndex< N > &DestOffset, const MultiArray< N, Source > &SrcArray, const MultiIndex< N > &SrcOffset, const Converter &C)
- Copy data from the source array to the destination array, whereby the destination array must be larger than or equal to the source array.
-
template<class Dest , class Source , int N, class Converter > void Fiber::CopySubset (const MultiIndex< N > &HowMany, MultiArray< N, Dest > &DestArray, const MultiIndex< N > &DestOffset, const MultiArray< N, Source > &SrcArray, const MultiIndex< N > &SrcOffset, const Converter &C)
- Copy a subset of data from the source array to the destination array.
-
template<int Dims> FixedArray< double, Dims > Fiber::MultiIndex::div (const MultiIndex< Dims > &Divisor, const MultiIndex< Dims > &Dividend)
- Compute the rational division of two MultiIndex es.
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.