133 #ifndef AFF_ARRAY_H_VERSION 135 #define AFF_ARRAY_H_VERSION \ 447 Tshape newshape(s0, s1, s2, s3);
457 using Tbase::operator();
549 "ERROR (ConstArray): invalid shape");
552 "ERROR (ConstArray): shape and representation are inconsistent");
574 { Mrepresentation[st.
current()]=value; }
580 #endif // AFF_ARRAY_H_VERSION (includeguard) const T & Tconst_reference
Type of reference to const element.
T & operator()(const Tsubscript &i0, const Tsubscript &i1) const
access from 2 index values
Array & copyin(const C &a)
copy values (deep copy) from other array of convertible type
const T Tconst_value
const element type
Root namespace of library.
Shape for a rectangular array layout.
aff::Strided Tshape
Type of shape.
T & operator()(const Tsubscript &i0, const Tsubscript &i1, const Tsubscript &i2) const
access from 3 index values
T & operator()(const Tsubscript &i0) const
access from 1 index value
T & Treference
Type of reference to element.
Tshape::TIndexVec TIndexVec
we use this for one of the access operators
const Trepresentation & representation() const
return full access representation
const Trepresentation & representation() const
provide restricted access representation
void deepcopy(const S &source, T &target)
deep copy
Tshape::Tstepper Tstepper
Type of shape stepper.
T & operator()(const TIndexVec &index) const
full dimensionality access
Tshape::TIndexVec TIndexVec
we use this for one of the access operators
Tcontainer Tcoc
Short for Tcontainer_of_const.
const T & operator()(const Tsubscript &i0) const
access from 1 index value
ConstArray(const Tshape &shape, const Trepresentation &representation)
construct from shape and representation
const TIndexVec & first() const
return vector of first index values
const T & Tconst_reference
Type of reference to const element.
const T & operator()(const TIndexVec &index) const
full dimensionality access
StridedStepper & incr()
increment offset - return reference to itself
void check_consistency() const
check consitency between representation and shape
Array(const Tsize &s0, const Tsize &s1=1, const Tsize &s2=1, const Tsize &s3=1)
construct from dimension sizes
aff::ConstArray< T > Tbase
base is container of const (see specialization below)
Stepper class for strided shapes (prototypes)
A template class to share heap memory for different array projections.
const Tsubscript & first(const Tsubscript &i) const
first index of dimension
Array(const Tshape &shape)
construct from shape (defines size and layout)
const T * Tconst_pointer
Type of pointer to const element.
exceptions and error handling macros (prototypes)
aff::ConstSharedHeap< T > Trepresentation
Type of representation.
const T & operator()(const Tsubscript &i0, const Tsubscript &i1, const Tsubscript &i2, const Tsubscript &i3) const
access from 4 index values
T * Tpointer
Type of pointer to element.
Tcontainer Tcontainer_of_const
Type of the array of const values.
#define AFF_assert(C, M)
Check an assertion and report by throwing an exception.
const T & operator()(const Tsubscript &i0, const Tsubscript &i1, const Tsubscript &i2) const
access from 3 index values
shape of s strided array (prototypes)
const T Tconst_value
const element type
ConstArray()
construct from nothing (empty)
const Tshape & shape() const
provide access to const shape
ConstArray< T > Tcontainer
Type of this array.
shared heap representation (prototypes)
Tsize memory_size() const
total size of mapped memory range
external deep copy function (prototypes)
This is the base class for const elements.
T & Treference
Type of reference to element.
T * Tpointer
Type of pointer to element.
Tsize size() const
total number of mapped elements
const T * Tconst_pointer
Type of pointer to const element.
Full multi-dimensional array functionality.This is the full array class template. It adds no addition...
Tcontainer & operator=(const T &value)
set whole array to value
const TIndexVec & last() const
return vector of last index values
T & operator()(const Tsubscript &i0, const Tsubscript &i1, const Tsubscript &i2, const Tsubscript &i3) const
access from 4 index values
Array(const Tshape &shape, const Trepresentation &representation)
construct from shape and representation
aff::SharedHeap< T > Trepresentation
Type of representation.
Array()
construct from nothing (empty)
const Tsubscript & current() const
return current index value for Representation access
Tbase Tcoc
short for Tcontainer_of_const
Tshape & shape()
allow shape manipulation
aff::Strided Tshape
Type of subscriptor.
StridedStepper & tofirst()
set current element index to the first - return reference to itself
Tbase Tcontainer_of_const
Type of the array of const values.
A stepper for all strided shapes.
ptrdiff_t Tsubscript
Type to hold an array's subscript value.
const Tsubscript & l(const Tsubscript &i) const
return last index of dimension i
Trepresentation Mrepresentation
representation member
const T & operator()(const Tsubscript &i0, const Tsubscript &i1) const
access from 2 index values
const bool & valid() const
valid if not passed end or beginning
Array base classThis is a multidimensional (array) container that uses a strided memory layout (Fortr...
const Tsubscript & f(const Tsubscript &i) const
return first index of dimension i
Trepresentation Mrepresentation
my (mutable) data representation
const Tsubscript & last(const Tsubscript &i) const
last index of dimension
Array< T > copyout() const
create an identical copy (deep copy) of this array
Tsubscript offset(const TIndexVec &index) const
full dimensionality access
size_t Tsize
Type to hold the size of an array dimension.
Array< T > Tcontainer
Type of this array.