Public Types | Public Member Functions | Public Attributes

Fiber::DirectProductMemArrayBase< T, MDIMS > Class Template Reference
[Multidimensional arrays whose values are direct products.]

Class for creating structured types as direct product of one-dimensional arrays. More...

#include <DirectProductArray.hpp>

List of all members.

Public Types

Public Member Functions

Public Attributes


Detailed Description

template<class T, int MDIMS>
class Fiber::DirectProductMemArrayBase< T, MDIMS >

Class for creating structured types as direct product of one-dimensional arrays.

An n-dimensional data type is defined over an n-dimensional manifold by assigning the value of the ith coordinate index to the ith component of the data type. Thus, given a set of $n$ one-dimensional arrays $A_i$, the resulting field is $A_0 \otimes A_1 \otimes \dots A_{n-1}$.

Examples for the one-dimensional component arrays can be data arrays explicitely specifying values, or a procedural array like the PolynomialArray<> that computes the data value from a set of coefficients. All component arrays must be childs of the virtual 1D array class VArray1D<>.

Parameters:
T The type that is created from the respective arrays at each index. It must provide an SIZE enum constant integer and a member typedef "value_type", such that T is equivalent to value_type[SIZE]. Only homogeneous types are allowed. The type T must also provide an element access operator [] that is accessible with an int and is convertible to the value_type.

Member Enumeration Documentation

template<class T, int MDIMS>
anonymous enum
Enumerator:
COMPONENTS 

The number of components of the value type.

Dims 

The dimensionality of the base manifold.


Constructor & Destructor Documentation

template<class T, int MDIMS>
Fiber::DirectProductMemArrayBase< T, MDIMS >::DirectProductMemArrayBase ( const MemBase::Creator_t C = MemCore::NullPtr()  )  [inline]

The constructor sets the component map such that the dimensions of the manifold are mapped to the first components of the structure.

All other components are set according to the value of this->origin, which is component-wise initialized with zero.


Member Function Documentation

template<class T, int MDIMS>
override RefPtr<MemBase> Fiber::DirectProductMemArrayBase< T, MDIMS >::createEquallySizedMemArray ( const RefPtr< MemCore::ChunkBase > &  Storage,
const MemBase::Creator_t C 
) const [inline]

Create a memory array of the same dimensions as the current array, but with data as provided by the Storage.

Will return NullPtr if the sizes don't match. Calls createMemArray() .

template<class T, int MDIMS>
RefPtr<MemArray<MDIMS,T> > Fiber::DirectProductMemArrayBase< T, MDIMS >::createMemArray ( const RefPtr< MemCore::ChunkBase > &  Data,
const MemBase::Creator_t C 
) const [inline]

Create a memory array of the same dimensions as the current array, but with data as provided by the Storage.

Will return NullPtr if the sizes don't match.

Referenced by Fiber::DirectProductMemArrayBase< Eagle::point3::FixedArray_t, MDIMS >::createEquallySizedMemArray().


Member Data Documentation

template<class T, int MDIMS>
Eagle::Vector<int, Dims> Fiber::DirectProductMemArrayBase< T, MDIMS >::ComponentMap

Mapping from manifold dimension to component array.

Unused entries are marked by negative values; those components will be set to zero.

Referenced by Fiber::DirectProductMemArrayBase< Eagle::point3::FixedArray_t, MDIMS >::DirectProductMemArrayBase().