Array< D, T > Class Template Reference
[Data]

multi dimensional arrays More...

#include <array.h>

Inheritance diagram for Array< D, T >:
Inheritance graph
[legend]
Collaboration diagram for Array< D, T >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef T value
typedef Array< 1, Tvector
typedef Array< 2, Tmatrix
typedef ArrayIterator< D, T,
false, 0, false
values
typedef ArrayIterator< D, T,
false, 0, true
ordered
typedef ArrayIterator< D, T,
true,0, false
positions
typedef ArrayIterator< D, T,
false, 1, false
vector_values
typedef ArrayIterator< D, T,
true,1, false
vector_positions
typedef ArrayIterator< D, T,
true,1, true
ordered_vectors
typedef ArrayIterator< D, T,
false, 2, false
matrix_values
typedef ArrayIterator< D, T,
true,2, false
matrix_positions

Public Member Functions

 Array ()
 Array (Size< D > size)
 Array (int x)
 Array (int x, int y)
 Array (int x, int y, int z)
 Array (int x, int y, int z, int a)
 Array (int x, int y, int z, int a, int b, int c)
 Array (const Array< D, T > &m)
 Array (SpecialStorage< T > *store, Size< D > sizes)
template<int O>
 Array (const Array< O, T > &m)
template<int O>
 Array (const Array< O, T > &other, const Select< D > &selected)
Array< D, T > & operator= (const Array< D, T > &m)
Array< D, T > & operator= (const T &m)
Array< D, T > & operator+= (const T &m)
Array< D, T > & operator+= (const Array< D, T > &m)
Array< D, T > & operator-= (const T &m)
Array< D, T > & operator/= (const T &m)
Array< D, T > & operator*= (const T &m)
Array< D, Toperator* (const T m) const
Array< D, Toperator/ (const T m) const
Array< D, Toperator+ (const Array< D, T > &m) const
 ~Array ()
Array< D, Toperator() (const From< D > &from) const
Array< D, Toperator() (const To< D > &to) const
Array< D, Toperator() (const Size< D > &s) const
Array< D, Toperator() (const From< D > &from, const To< D > &to) const
Array< D, Toperator() (const From< D > &from, const Size< D > &size) const
template<int O>
Array< O, Toperator() (const Select< O > keep) const
void setAddress (T *start)
int size (int i) const
Size< D > size () const
bool empty () const
Delta< D > delta () const
int delta (int i) const
Taddress (Position< D > i) const
Toperator[] (Position< D > i) const
bool operator== (const Array< D, T > &m) const
bool operator!= (const Array< D, T > &m) const
void printMetaInfo () const
template<class F >
void copyFrom (const Array< D, F > &source)
void copyFrom (const Array< D, T > &source, const From< D > &where)
virtual Data getField (QString e)

Public Attributes

ArrayMeta< D, T > * content

Protected Member Functions

virtual QString type_name () const
virtual DataClassshallow_copy () const
virtual void visit (DataVisitor &v)
 Array (ArrayMeta< D, T > *content_with_correct_refcount)

Detailed Description

template<int D, class T>
class Array< D, T >

multi dimensional arrays

Multidimensional arrays were conceived for a number of reasons. In various software we needed some way to handle large volumes of data while providing different views on the data. Currently, giving the considerations of a read-only memory this library would probably be redefined completely. Nevertheless at that time, my main interest was the multidimensional operations that were possible and a way to store retrieve them in a platform transparent manner. Some of the uses:

BpmDj

Gel Analysis

Petri-nets

The problem of cross platform access to data has not yet vanished, as such most of these data expression are still useful to read data from files and save it if we write our own flow modules.


Member Typedef Documentation

template<int D, class T>
typedef Array<2,T> Array< D, T >::matrix
template<int D, class T>
typedef ArrayIterator<D,T,true ,2,false> Array< D, T >::matrix_positions
template<int D, class T>
typedef ArrayIterator<D,T,false,2,false> Array< D, T >::matrix_values
template<int D, class T>
typedef ArrayIterator<D,T,false,0,true> Array< D, T >::ordered
template<int D, class T>
typedef ArrayIterator<D,T,true ,1,true> Array< D, T >::ordered_vectors
template<int D, class T>
typedef ArrayIterator<D,T,true ,0,false> Array< D, T >::positions
template<int D, class T>
typedef T Array< D, T >::value
template<int D, class T>
typedef ArrayIterator<D,T,false,0,false> Array< D, T >::values
template<int D, class T>
typedef Array<1,T> Array< D, T >::vector
template<int D, class T>
typedef ArrayIterator<D,T,true ,1,false> Array< D, T >::vector_positions
template<int D, class T>
typedef ArrayIterator<D,T,false,1,false> Array< D, T >::vector_values

Constructor & Destructor Documentation

template<int D, class T>
Array< D, T >::Array ( ArrayMeta< D, T > *  content_with_correct_refcount  )  [inline, protected]
template<int D, class T>
Array< D, T >::Array (  )  [inline]
template<int D, class T>
Array< D, T >::Array ( Size< D >  size  )  [inline]
template<int D, class T>
Array< D, T >::Array ( int  x  )  [inline]
template<int D, class T>
Array< D, T >::Array ( int  x,
int  y 
) [inline]
template<int D, class T>
Array< D, T >::Array ( int  x,
int  y,
int  z 
) [inline]
template<int D, class T>
Array< D, T >::Array ( int  x,
int  y,
int  z,
int  a 
) [inline]
template<int D, class T>
Array< D, T >::Array ( int  x,
int  y,
int  z,
int  a,
int  b,
int  c 
) [inline]
template<int D, class T>
Array< D, T >::Array ( const Array< D, T > &  m  )  [inline]
template<int D, class T>
Array< D, T >::Array ( SpecialStorage< T > *  store,
Size< D >  sizes 
) [inline]

This constructor accepts a SpecialStorage type (see array-storage). It will increase the reference counter immediately with one, effectively taking ownership of the data since it will also delete the data when the counter reaches zero.

template<int D, class T>
template<int O>
Array< D, T >::Array ( const Array< O, T > &  m  )  [inline]

this constructor will refer to the same data but assume the array has a different dimensionality remaining dimensions will be padded with size 1. O must be smaller than T;

References Array< D, T >::content.

template<int D, class T>
template<int O>
Array< D, T >::Array ( const Array< O, T > &  other,
const Select< D > &  selected 
) [inline]

this constructor can be used when O is larger than T. In that case only the selected dimensions will remain.

References Array< D, T >::content.

template<int D, class T>
Array< D, T >::~Array (  )  [inline]

Member Function Documentation

template<int D, class T>
T* Array< D, T >::address ( Position< D >  i  )  const [inline]
template<int D, class T>
void Array< D, T >::copyFrom ( const Array< D, T > &  source,
const From< D > &  where 
) [inline]

Will set an area of this area to the array given in o. No boundary warnings are given, but no ill result should happen either. In other words, the copy area will be limited to the size of the possible target area.

References Array< D, T >::copyFrom(), Size< D >::min(), and Array< D, T >::size().

template<int D, class T >
template<class F >
void Array< D, T >::copyFrom ( const Array< D, F > &  source  )  [inline]

will copy the data in source to target using the assignment operator Both sizes must be equal and valid

References ArrayIteratorBacking< T, PT >::more(), and T.

Referenced by Array< D, T >::copyFrom(), Array< D, T >::operator*(), and Array< D, T >::operator/().

template<int D, class T>
int Array< D, T >::delta ( int  i  )  const [inline]
template<int D, class T>
Delta<D> Array< D, T >::delta (  )  const [inline]
template<int D, class T>
bool Array< D, T >::empty (  )  const [inline]
template<int D, class T >
Data Array< D, T >::getField ( QString  ref  )  [inline, virtual]

setting and getting of subtrees and values

Reimplemented from DataClass.

References assert(), and Array< D, T >::size().

template<int D, class T>
bool Array< D, T >::operator!= ( const Array< D, T > &  m  )  const [inline]
template<int D, class T>
template<int O>
Array<O,T> Array< D, T >::operator() ( const Select< O >  keep  )  const [inline]
template<int D, class T>
Array<D,T> Array< D, T >::operator() ( const From< D > &  from,
const Size< D > &  size 
) const [inline]
template<int D, class T>
Array<D,T> Array< D, T >::operator() ( const From< D > &  from,
const To< D > &  to 
) const [inline]
template<int D, class T>
Array<D,T> Array< D, T >::operator() ( const Size< D > &  s  )  const [inline]
template<int D, class T>
Array<D,T> Array< D, T >::operator() ( const To< D > &  to  )  const [inline]
template<int D, class T>
Array<D,T> Array< D, T >::operator() ( const From< D > &  from  )  const [inline]
template<int D, class T>
Array< D, T > Array< D, T >::operator* ( const T  m  )  const [inline]
template<int D, class T>
Array< D, T > & Array< D, T >::operator*= ( const T m  )  [inline]
template<int D, class T>
Array< D, T > Array< D, T >::operator+ ( const Array< D, T > &  m  )  const [inline]

References assert(), and Array< D, T >::size().

template<int D, class T>
Array< D, T > & Array< D, T >::operator+= ( const Array< D, T > &  m  )  [inline]
template<int D, class T>
Array< D, T > & Array< D, T >::operator+= ( const T m  )  [inline]
template<int D, class T>
Array< D, T > & Array< D, T >::operator-= ( const T m  )  [inline]
template<int D, class T>
Array< D, T > Array< D, T >::operator/ ( const T  m  )  const [inline]
template<int D, class T>
Array< D, T > & Array< D, T >::operator/= ( const T m  )  [inline]
template<int D, class T>
Array< D, T > & Array< D, T >::operator= ( const T m  )  [inline]

The assignment operator will set the content of the array to the given value using the = operator. This function is optimized in cases the array can be treated in linear blocks.

References ArrayIteratorBacking< T, PT >::linear(), ArrayIteratorBacking< T, PT >::more(), ArrayIteratorBacking< T, PT >::size(), ArrayIteratorBacking< T, PT >::skipBlock(), and T.

template<int D, class T>
Array< D, T > & Array< D, T >::operator= ( const Array< D, T > &  m  )  [inline]
template<int D, class T>
bool Array< D, T >::operator== ( const Array< D, T > &  m  )  const [inline]
template<int D, class T>
T& Array< D, T >::operator[] ( Position< D >  i  )  const [inline]
template<int D, class T >
void Array< D, T >::printMetaInfo (  )  const [inline]
template<int D, class T>
void Array< D, T >::setAddress ( T start  )  [inline]
template<int D, class T>
virtual DataClass* Array< D, T >::shallow_copy (  )  const [inline, protected, virtual]

The shallow_copy function should be overridden to return a shallow copy of the own object, but allocated with new.

Implements DataClass.

template<int D, class T>
Size<D> Array< D, T >::size (  )  const [inline]
template<int D, class T>
int Array< D, T >::size ( int  i  )  const [inline]
template<int D, class T>
virtual QString Array< D, T >::type_name (  )  const [inline, protected, virtual]

Implements DataClass.

Referenced by Array< SM, T >::type_name().

template<int D, class T>
virtual void Array< D, T >::visit ( DataVisitor v  )  [inline, protected, virtual]

Implements DataClass.


Member Data Documentation

template<int D, class T>
ArrayMeta<D,T>* Array< D, T >::content

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by  doxygen 1.6.2