AFF --- A container for numbers (array) by Friederich and Forbriger.
|
Array base classThis is a multidimensional (array) container that uses a strided memory layout (Fortran shape) and counted references to data in global memory. For examples see the various test programs. More...
#include <array.h>
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. 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. | |
typedef aff::ConstSharedHeap< T > | Trepresentation |
Type of representation. More... | |
typedef aff::Strided | Tshape |
Type of shape. More... | |
typedef Tshape::Tstepper | Tstepper |
Type of shape stepper. 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... | |
typedef ConstArray< T > | Tcontainer |
Type of this array. More... | |
typedef Tcontainer | Tcontainer_of_const |
Type of the array of const values. More... | |
typedef Tcontainer | Tcoc |
Short for Tcontainer_of_const. More... | |
Public Member Functions | |
Array< T > | copyout () const |
create an identical copy (deep copy) of this array More... | |
const Tshape & | shape () const |
provide access to const shape More... | |
Tshape & | shape () |
allow shape manipulation More... | |
const Trepresentation & | representation () const |
provide restricted access representation More... | |
Constructors | |
| |
ConstArray () | |
construct from nothing (empty) More... | |
ConstArray (const Tshape &shape, const Trepresentation &representation) | |
construct from shape and representation More... | |
Const access operators | |
Although we generally distinguish between the constness of the container and the constness of the contained data (see Notes on the const-correctness of arrays), we provide const element access operators the prohibit element modification. We assume that a const version of the array is usually meant to be used only for reading. | |
const T & | operator() (const TIndexVec &index) const |
full dimensionality access More... | |
const T & | operator() (const Tsubscript &i0) const |
access from 1 index value More... | |
const T & | operator() (const Tsubscript &i0, const Tsubscript &i1) const |
access from 2 index values More... | |
const T & | operator() (const Tsubscript &i0, const Tsubscript &i1, const Tsubscript &i2) const |
access from 3 index values More... | |
const T & | operator() (const Tsubscript &i0, const Tsubscript &i1, const Tsubscript &i2, const Tsubscript &i3) const |
access from 4 index values More... | |
Shape access | |
const Tsubscript & | f (const Tsubscript &i) const |
return first index of dimension i More... | |
const Tsubscript & | l (const Tsubscript &i) const |
return last index of dimension i More... | |
access declarations | |
const Tsubscript & | first (const Tsubscript &i) const |
access to base class function More... | |
const TIndexVec & | first () const |
access to base class function More... | |
const Tsubscript & | last (const Tsubscript &i) const |
last index of dimension More... | |
const TIndexVec & | last () 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 Types | |
typedef SimpleRigidArray< Tsize, Mmax_dimen > | TSizeVec |
type of size and stride array (always positive) More... | |
Private Member Functions | |
void | check_consistency () const |
check consitency between representation and shape More... | |
Access to shape | |
Tsize | memory_size () const |
total size of mapped memory range More... | |
Tsize | size () const |
total number of mapped elements More... | |
Tsize | size (const Tsubscript &i) const |
size of dimension More... | |
Tsubscript | first_offset () const |
first mapped position More... | |
Tsubscript | last_offset () const |
last mapped position More... | |
const Tsubscript & | first (const Tsubscript &i) const |
first index of dimension More... | |
const TIndexVec & | first () const |
return vector of first index values More... | |
const Tsubscript & | last (const Tsubscript &i) const |
last index of dimension More... | |
const TIndexVec & | last () const |
return vector of last index values More... | |
const Tsize & | stride (const Tsubscript &i) const |
stride of dimension More... | |
const TSizeVec & | stride () const |
return vector of stride values More... | |
Map index values to linear representation range | |
Tsubscript | offset (const TIndexVec &index) const |
full dimensionality access More... | |
Tsubscript | offset (const Tsubscript &i0) const |
offset from 1 index value More... | |
Tsubscript | offset (const Tsubscript &i0, const Tsubscript &i1) const |
offset from 2 index values More... | |
Tsubscript | offset (const Tsubscript &i0, const Tsubscript &i1, const Tsubscript &i2) const |
offset from 3 index values More... | |
Tsubscript | offset (const Tsubscript &i0, const Tsubscript &i1, const Tsubscript &i2, const Tsubscript &i3) const |
offset from 4 index values More... | |
Support for slices and subarrays | |
| |
Strided & | shrink (const TIndexVec &last) |
subarray More... | |
Strided & | shrink (const TIndexVec &first, const TIndexVec &last) |
subarray More... | |
Strided & | shrink (const Tdim &i, const Tsubscript &first, const Tsubscript &last) |
subarray More... | |
Strided & | shrink (const Tdim &i, const Tsubscript &last) |
subarray More... | |
Strided & | collapse (const Tdim &i, const Tsubscript &index) |
slice More... | |
Strided & | shift (const Tdim &i, const Tsubscript &index) |
shift More... | |
Strided & | shift (const TIndexVec &index) |
shift More... | |
Strided & | setfirst (const Tdim &i, const Tsubscript &index) |
setfirst More... | |
Strided & | setfirst (const TIndexVec &index) |
setfirst More... | |
Private Attributes | |
Trepresentation | Mrepresentation |
representation member More... | |
Static Private Attributes | |
static const Tdim | Mmax_dimen =4 |
instantiate static member (otherwise the linker won't find it) More... | |
Array base class
This is a multidimensional (array) container that uses a strided memory layout (Fortran shape) and counted references to data in global memory. For examples see the various test programs.