A generic multidimensional array is a one-dimensional pointer together with a specification of the extent in some dimensions.
More...
#include <MultiArray.hpp>
List of all members.
Public Types
Public Member Functions
-
MultiArrayBase (T *data, const MultiIndex< Dims > &Extension, DataCreator< T > *Crec)
- Constructor.
-
MultiArrayBase (const Iterator< T > &data, const MultiIndex< Dims > &Extension, DataCreator< T > *TheCreator=0)
- Constructor.
-
MultiArrayBase (const MultiArrayBase &MAB)
- Copy Constructor.
-
unsigned long memsize () const
- Return the number of bytes occupied by this MultiArray.
-
const Storage_t & storage () const
- Reference to the stored data.
-
const MultiIndex< Dims > & Size () const
- Dimensionality.
-
void Resize (T *data, const MultiIndex< N > &D)
- Change stored dimensionality, use with care.
-
index_t nElements () const
- number of elements in here
- reference_t operator[] (const MultiIndex< N > &I) const
- Element access.
- Slice_t slice (index_t i) const
- Extract an N-1 dimensional slice of the current data set for read-only access.
-
Slice_t operator[] (index_t i) const
-
reference_t first () const
-
reference_t last () const
Detailed Description
template<int N, class T>
class MultiArrayBase< N, T >
A generic multidimensional array is a one-dimensional pointer together with a specification of the extent in some dimensions.
Data are stored in a one-dimensional container and accessed via a multidimensional index.
- Note:
- MultiArray's are lightweight, i.e. they can be copied easily and even be returned by a function. They consist of an Iterator plus one integer for each dimension.
Member Function Documentation
template<int N, class T>
reference_t MultiArrayBase< N, T >::operator[] |
( |
const MultiIndex< N > & |
I |
) |
const [inline] |
Element access.
- Todo:
- Creation of elements not tested!
Extract an N-1 dimensional slice of the current data set for read-only access.
The returned objects contain a pointer to the original data (which are shared with the hyperslab) and N-1 indices referring to the respective dimensions. Note that the hyperslab data reside contigously in memory.
- Examples:
- CreatorExample.cpp.