Stop the recursive definition of multidimensional arrays.
More...
#include <MultiArray.hpp>
List of all members.
Public Types
Public Member Functions
-
MultiArrayBase (const Iterator< T > &data, const MultiIndex< Dims > &Extension, DataCreator< T > *Crec)
- One-dimensional constructor.
-
const Storage_t & storage () const
- Reference to the stored data.
-
void Resize (T *newData, const MultiIndex< 1 > &D)
- Change internally stored memory layout.
-
void Resize (T *newData, const index_t &D)
- Change internally stored memory layout, shortcut for 1D.
-
unsigned long memsize () const
- Return the number of bytes occupied by this MultiArray.
-
Iterator< T > getData (index_t i) const
-
const MultiIndex< Dims > & Size () const
- Return the number of elements in each direction, a multidimensional index.
-
index_t nElements () const
- Return the total number of elements This is equivalent to calling Size().size().
-
const reference_t operator[] (index_t i) const
- Return a stored element accessed by a linear index possible invoking the local creator if such exists.
-
reference_t operator[] (index_t i)
- Return a reference to a stored element via a linear index, possible invoking the local creator if such exists.
-
const reference_t operator[] (const MultiIndex< 1 > &I) const
- Index via multidimensional index, readonly.
-
reference_t operator[] (const MultiIndex< 1 > &I)
- Access via multidimensional index, modifyable.
-
const reference_t slice (index_t i) const
-
const reference_t first () const
- Return reference to the first element.
-
const reference_t last () const
- Return last element in the array.
Public Attributes
-
MultiIndex< Dims > dimensions
Detailed Description
template<class T>
class MultiArrayBase< 1, T >
Stop the recursive definition of multidimensional arrays.
- Note:
- At each element access, the access function checks for the existence of an Creator. This additional conditional check turns down performance significantly. However, it is required as all the elements of even a logically consecutive slice might reside in different blocks of data, and in this worst case each block needs to be checked. Any better solution here would be greatly appreciated!!