multi dimensional arrays More...
#include <array.h>


Public Types | |
| typedef T | value |
| typedef Array< 1, T > | vector |
| typedef Array< 2, T > | matrix |
| 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, T > | operator* (const T m) const |
| Array< D, T > | operator/ (const T m) const |
| Array< D, T > | operator+ (const Array< D, T > &m) const |
| ~Array () | |
| Array< D, T > | operator() (const From< D > &from) const |
| Array< D, T > | operator() (const To< D > &to) const |
| Array< D, T > | operator() (const Size< D > &s) const |
| Array< D, T > | operator() (const From< D > &from, const To< D > &to) const |
| Array< D, T > | operator() (const From< D > &from, const Size< D > &size) const |
| template<int O> | |
| Array< O, T > | operator() (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 |
| T * | address (Position< D > i) const |
| T & | operator[] (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 DataClass * | shallow_copy () const |
| virtual void | visit (DataVisitor &v) |
| Array (ArrayMeta< D, T > *content_with_correct_refcount) | |
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.
| typedef ArrayIterator<D,T,true ,2,false> Array< D, T >::matrix_positions |
| typedef ArrayIterator<D,T,false,2,false> Array< D, T >::matrix_values |
| typedef ArrayIterator<D,T,true ,1,true> Array< D, T >::ordered_vectors |
| typedef ArrayIterator<D,T,true ,1,false> Array< D, T >::vector_positions |
| typedef ArrayIterator<D,T,false,1,false> Array< D, T >::vector_values |
| Array< D, T >::Array | ( | ArrayMeta< D, T > * | content_with_correct_refcount | ) | [inline, protected] |
| 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.
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.
| 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.
Referenced by Array< SM, T >::operator[]().
| 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().
| 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/().
Referenced by histogram_property< bandsize >::set_data().
setting and getting of subtrees and values
Reimplemented from DataClass.
References assert(), and Array< D, T >::size().
| Array<O,T> Array< D, T >::operator() | ( | const Select< O > | keep | ) | const [inline] |
| Array<D,T> Array< D, T >::operator() | ( | const From< D > & | from, | |
| const Size< D > & | size | |||
| ) | const [inline] |
| Array<D,T> Array< D, T >::operator() | ( | const From< D > & | from, | |
| const To< D > & | to | |||
| ) | const [inline] |
| Array<D,T> Array< D, T >::operator() | ( | const Size< D > & | s | ) | const [inline] |
| Array<D,T> Array< D, T >::operator() | ( | const From< D > & | from | ) | const [inline] |
References Array< D, T >::copyFrom(), and Array< D, T >::size().
| Array< D, T > Array< D, T >::operator+ | ( | const Array< D, T > & | m | ) | const [inline] |
References assert(), and Array< D, T >::size().
| Array< D, T > & Array< D, T >::operator+= | ( | const Array< D, T > & | m | ) | [inline] |
References Array< D, T >::copyFrom(), and Array< D, T >::size().
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.
| Array< D, T > & Array< D, T >::operator= | ( | const Array< D, T > & | m | ) | [inline] |
References Array< D, T >::content.
References Array< D, T >::content.
References Array< D, T >::content.
| 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.
| virtual QString Array< D, T >::type_name | ( | ) | const [inline, protected, virtual] |
Implements DataClass.
Referenced by Array< SM, T >::type_name().
| virtual void Array< D, T >::visit | ( | DataVisitor & | v | ) | [inline, protected, virtual] |
Implements DataClass.
Referenced by Array< SM, T >::address(), Array< D, T >::Array(), Array< SM, T >::Array(), Array< SM, T >::delta(), Array< SM, T >::empty(), Array< SM, T >::operator()(), Array< D, T >::operator=(), Array< D, T >::operator==(), Array< D, T >::printMetaInfo(), Array< SM, T >::setAddress(), and Array< SM, T >::size().
1.6.2