FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
Public Types | Public Member Functions | Static Public Attributes | List of all members

A generic multidimensional array is a one-dimensional pointer together with a specification of the extent in some dimensions. More...

#include <MultiArray.hpp>

Inheritance diagram for Fiber::MultiArrayBase< N, T >:
Fiber::CreativeIterator< T > Fiber::Iterator< T > Fiber::IteratorBase< T > Fiber::ElementIterator< T > Fiber::HyperslabParameters Fiber::MultiArray< N, T, std::index_sequence< Is... > >

Public Types

typedef CreativeIterator< T > Base_t
 
typedefvalue_type
 The type of each element in this array.
 
typedef Iterator< T > Storage_t
 The layout of the stored data.
 
typedef Iterator< T > SliceStorge_t
 The storage type of a subslice.
 
typedef MultiArrayBase< N-1, T > Slice_t
 The type of a slice of this array All data in this slice are still contiguous.
 
typedef Iterator< T >::reference_t reference_t
 
typedef META::IF< MetaInfo< T >::MULTIPLICITY==1, component_t, FixedArray_t >::result ValueBase_t
 
typedef MetaInfo< T >::element_t component_t
 
- Public Types inherited from Fiber::CreativeIterator< T >
typedef MetaInfo< T >::element_t component_t
 
typedef FixedArray< component_t, MetaInfo< T >::MULTIPLICITY > FixedArray_t
 
typedef META::IF< MetaInfo< T >::MULTIPLICITY==1, component_t, FixedArray_t >::result ValueBase_t
 
typedef META::IF< MetaInfo< T >::MULTIPLICITY==1, void, FixedArray_t >::result FixedArrayBase_t
 If the type has a non-zero multiplicity, then there exists an associated base class of fixed arrays.
 
typedef Eagle::Vector< component_t, MetaInfo< T >::MULTIPLICITY > VectorArray_t
 
typedef META::IF< MetaInfo< T >::RANK==0, void, VectorArray_t >::result VectorArrayBase_t
 If the type has a non-zero rank, then there exists an associated base class of vectors.
 
- Public Types inherited from Fiber::Iterator< T >
typedef IteratorBase< T > Base_t
 
typedefvalue_t
 
typedef Eagle::MetaInfo< value_t > FI
 
typedef FI::element_t component_t
 
typedef ElementryArrayTrait< T >::basetype_t array_t
 
typedef T & reference_t
 The reference type.
 
- Public Types inherited from Fiber::ElementIterator< T >
typedef Eagle::MetaInfo< T > info_t
 
typedef info_t::element_t element_info_t
 

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.
 
constexpr unsigned long memsize () const
 Return the number of bytes occupied by this MultiArray.
 
constexpr const Storage_tstorage () const
 Reference to the stored data.
 
constexpr 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
 multidimensional element access
 
reference_t getElement (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
 
- Public Member Functions inherited from Fiber::CreativeIterator< T >
 CreativeIterator (const Iterator< T > &D, DataCreator< T > *C=0)
 
 CreativeIterator (index_t length, T *data, DataCreator< T > *C=0)
 
 CreativeIterator (const CreativeIterator &CI)
 
- Public Member Functions inherited from Fiber::Iterator< T >
 Iterator (index_t howmany, T *Ptr)
 Construct view pointer from contiguous storage.
 
 Iterator (const HyperslabParameters &P, T *Ptr)
 Construct iterator with alternative data, but otherwise compatible properties.
 
 Iterator (const Iterator &P)
 Copy Constructor.
 
 Iterator (const Iterator &P, int)
 Copy Constructor with irrelevant member selection2.
 
template<int Components>
 Iterator (index_t howmany, FixedArray< T, Components > *Ptr, int component)
 Construct view pointer to a single component within a contiguous storage of array objects.
 
template<int Components>
 Iterator (const Iterator< FixedArray< T, Components > > &It, int component)
 
template<int Components>
 Iterator (index_t Length, Eagle::VVector< Components, T > *Ptr, int component)
 Construct view pointer to a single component within a contigous storage of array objects.
 
 Iterator (index_t ishift, const Iterator &P, const Add &)
 Addition Constructor.
 
Iterator< array_tgetArrayIterator () const
 Get an iterator that operates on associated FixedArray<> subjects.
 
Iterator< component_t > getComponent (int n) const
 Get an iterator that operates on the nth component.
 
T & operator[] (index_t i) const
 Access an element of the array, writeable.
 
const T & getValue (index_t i) const
 Get the value, readonly.
 
void set (const T &Value)
 Set all elements to the same value.
 
const_ranged_for_iterator< T > begin () const
 
const_ranged_for_iterator< T > end () const
 
ranged_for_iterator< T > begin ()
 
ranged_for_iterator< T > end ()
 
template<class S >
T & operator[] (const ranged_for_iterator< S > &I)
 
template<class S >
const T & operator[] (const ranged_for_iterator< S > &I) const
 
template<class S >
T & operator[] (const const_ranged_for_iterator< S > &I)
 
template<class S >
const T & operator[] (const const_ranged_for_iterator< S > &I) const
 
- Public Member Functions inherited from Fiber::IteratorBase< T >
 IteratorBase (index_t Length, T *d, index_t Stride, index_t Offset)
 
 IteratorBase (const IteratorBase &IB)
 
 IteratorBase (const HyperslabParameters &IB, T *d)
 Construct compatible iterator with different data.
 
 IteratorBase (index_t ishift, const IteratorBase &P, const Add &)
 
- Public Member Functions inherited from Fiber::ElementIterator< T >
 ElementIterator (index_t Length, T *Data, index_t Stride, index_t Offset)
 Construct an element iterator.
 
 ElementIterator (const ElementIterator &It)
 Copy Constructor.
 
 ElementIterator (const HyperslabParameters &It, T *newData)
 Constructor compatible iterator with new data.
 
 ElementIterator (index_t i, const ElementIterator &It, const Add &)
 Addition Constructor.
 
void SetNewData (T *newData, index_t newLength) throw ()
 Change the stored data chunk to a new location and length.
 
T * ptr (int c=0) const
 Return pointer to data, which is good for C interface, but otherwise, avoid that.
 
T & getElement (index_t i, int c) const
 Element access (no range check!).
 
 operator bool () const
 Implicit conversion to boolean: Check whether this is a valid pointer.
 
- Public Member Functions inherited from Fiber::HyperslabParameters
 HyperslabParameters (index_t Length, index_t Stride, index_t Offset) throw ()
 Simple constructorm sets shift and cropped members to zero.
 
 HyperslabParameters (const HyperslabParameters &H) throw ()
 Copy constructor.
 
 HyperslabParameters (index_t i, const HyperslabParameters &H) throw ()
 Pointer addition constructor (sets the shift member).
 
index_t getLength () const throw ()
 Return the number of elements which can be accessed through this ElementIterator.
 
index_t getOffset () const throw ()
 
index_t getStride () const throw ()
 
index_t getShift () const throw ()
 
index_t getCropped () const throw ()
 
bool isSeparatedCompound () const throw ()
 Tell if the iterator refers to a data set which is built from arrays of structure members, i.e.
 
index_t multiplicity () const throw ()
 Return number of elements which form an entity.
 
index_t maxcount () const throw ()
 Return the number of steps which can be traversed through this ElementIterator.
 
index_t count () const throw ()
 Return the number of steps which can be traversed through this ElementIterator.
 
void setCount (index_t size) throw ()
 Set the maximally allowed count, i.e.
 
index_t getIndex (index_t i, int c) const throw ()
 Given a major and a minor index, compute the overall index in the dataset according to.
 
HyperslabParametersgetHyperslabParameters () throw ()
 
const HyperslabParametersgetHyperslabParameters () const throw ()
 

Static Public Attributes

static constexpr Dims_t Dims = N
 The dimensions of this array.
 

Additional Inherited Members

- Protected Member Functions inherited from Fiber::ElementIterator< T >
void incPtr (index_t what)
 
- Protected Attributes inherited from Fiber::CreativeIterator< T >
DataCreator< T > * myDataCreator
 
- Protected Attributes inherited from Fiber::ElementIterator< T >
index_t length
 The length (number of elements) of the data array.
 
index_t stride
 
index_t offset
 
index_t shift
 
index_t cropped
 
- Protected Attributes inherited from Fiber::HyperslabParameters
index_t length
 The length (number of elements) of the data array.
 
index_t stride
 
index_t offset
 
index_t shift
 
index_t cropped
 

Detailed Description

template<Dims_t N, class T>
class Fiber::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

◆ getElement()

template<Dims_t N, class T >
reference_t Fiber::MultiArrayBase< N, T >::getElement ( const MultiIndex< N > &  I) const
inline

◆ slice()

template<Dims_t N, class T >
Slice_t Fiber::MultiArrayBase< N, T >::slice ( index_t  i) const
inline

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.

References Fiber::MultiArrayBase< N, T >::Dims, and Fiber::ElementIterator< T >::ptr().