AFF --- A container for numbers (array) by Friederich and Forbriger.
aff::Array< T > Class Template Reference

Full multi-dimensional array functionality.This is the full array class template. It adds no additional functionality to its base class aff::ConstArray. But it provied acess to all member functions of the base, also to functions that allow data modification. More...

#include <array.h>

Inheritance diagram for aff::Array< T >:
Collaboration diagram for aff::Array< T >:

Public Types

Various types

In particular due to our concept of const-correctness we need several typedefs to declare types derived from the element type of the array.

See also
Member typedefs
Notes on the const-correctness of arrays
typedef Array< T > Tcontainer
 Type of this array. More...
 
typedef aff::ConstArray< T > Tbase
 base is container of const (see specialization below) More...
 
typedef Tbase Tcontainer_of_const
 Type of the array of const values. More...
 
typedef Tbase Tcoc
 short for Tcontainer_of_const More...
 
typedef aff::SharedHeap< T > Trepresentation
 Type of representation. More...
 
typedef aff::Strided Tshape
 Type of subscriptor. More...
 
typedef Tshape::TIndexVec TIndexVec
 we use this for one of the access operators More...
 
typedef T Tvalue
 Element type. More...
 
typedef T * Tpointer
 Type of pointer to element. More...
 
typedef T & Treference
 Type of reference to element. More...
 
typedef const T Tconst_value
 const element type More...
 
typedef const T * Tconst_pointer
 Type of pointer to const element. More...
 
typedef const T & Tconst_reference
 Type of reference to const element. More...
 
Various types

In particular due to our concept of const-correctness we need several typedefs to declare types derived from the element type of the array.

This is in particular usefull for function templates that may take any container class as argument (e.g. aff::subarray) or for other classes dealing with any container (e.g. aff::Iterator). By means of these typedefs they may retrieve appropriate types they have to deal with.

See also
Member typedefs
Notes on the const-correctness of arrays
typedef Tshape::Tstepper Tstepper
 Type of shape stepper. More...
 

Public Member Functions

template<class C >
Arraycopyin (const C &a)
 copy values (deep copy) from other array of convertible type More...
 
const Trepresentationrepresentation () const
 return full access representation More...
 
Tcontaineroperator= (const T &value)
 set whole array to value More...
 
T & operator() (const TIndexVec &index) const
 full dimensionality access More...
 
T & operator() (const Tsubscript &i0) const
 access from 1 index value More...
 
T & operator() (const Tsubscript &i0, const Tsubscript &i1) const
 access from 2 index values More...
 
T & operator() (const Tsubscript &i0, const Tsubscript &i1, const Tsubscript &i2) const
 access from 3 index values More...
 
T & operator() (const Tsubscript &i0, const Tsubscript &i1, const Tsubscript &i2, const Tsubscript &i3) const
 access from 4 index values More...
 
Array< T > copyout () const
 create an identical copy (deep copy) of this array More...
 
const Tshapeshape () const
 provide access to const shape More...
 
Tshapeshape ()
 allow shape manipulation More...
 
Constructors
Note
We use the default copy constructor, which automatically invokes the copy constructors of the base classes aff::Strided and aff::SharedHeap<T>. This essentially is a shallow copy of the array, i.e. the copy will reference to the same elements in memory. See aff::Array<T>::copyin() and aff::Array<T>::copyout() for deep copy operations.
 Array ()
 construct from nothing (empty) More...
 
 Array (const Tshape &shape, const Trepresentation &representation)
 construct from shape and representation More...
 
 Array (const Tshape &shape)
 construct from shape (defines size and layout) More...
 
 Array (const Tsize &s0, const Tsize &s1=1, const Tsize &s2=1, const Tsize &s3=1)
 construct from dimension sizes More...
 
access declarations
const Tshapeshape () const
 provide access to const shape More...
 
Tshapeshape ()
 allow shape manipulation More...
 
Array< T > copyout () const
 create an identical copy (deep copy) of this array More...
 
Shape access
const Tsubscriptf (const Tsubscript &i) const
 return first index of dimension i More...
 
const Tsubscriptl (const Tsubscript &i) const
 return last index of dimension i More...
 
access declarations
const Tsubscriptfirst (const Tsubscript &i) const
 access to base class function More...
 
const TIndexVecfirst () const
 access to base class function More...
 
const Tsubscriptlast (const Tsubscript &i) const
 last index of dimension More...
 
const TIndexVeclast () const
 return vector of last index values More...
 
Tsize size () const
 total number of mapped elements More...
 
Tsize size (const Tsubscript &i) const
 size of dimension More...
 

Protected Member Functions

Tsubscript offset (const TIndexVec &index) const
 provide access to shape offset functions for derived class More...
 
Tsubscript offset (const Tsubscript &i0) const
 provide access to shape offset functions for derived class More...
 
Tsubscript offset (const Tsubscript &i0, const Tsubscript &i1) const
 provide access to shape offset functions for derived class More...
 
Tsubscript offset (const Tsubscript &i0, const Tsubscript &i1, const Tsubscript &i2) const
 provide access to shape offset functions for derived class More...
 
Tsubscript offset (const Tsubscript &i0, const Tsubscript &i1, const Tsubscript &i2, const Tsubscript &i3) const
 provide access to shape offset functions for derived class More...
 

Private Attributes

Trepresentation Mrepresentation
 my (mutable) data representation More...
 

Detailed Description

template<class T>
class aff::Array< T >

Full multi-dimensional array functionality.

This is the full array class template. It adds no additional functionality to its base class aff::ConstArray. But it provied acess to all member functions of the base, also to functions that allow data modification.

See also
aff::ConstArray
Notes on the const-correctness of arrays
Replicated ConstSharedHeap
Examples:
tests/arraytest.cc, tests/f77test.cc, tests/helpertest.cc, and tests/operatortest.cc.

Definition at line 151 of file array.h.


The documentation for this class was generated from the following file: