AFF --- A container for numbers (array) by Friederich and Forbriger.
|
Shape for a rectangular array layout. More...
#include <strided.h>
Public Types | |
typedef SimpleRigidArray< Tsize, Mmax_dimen > | TSizeVec |
type of size and stride array (always positive) More... | |
typedef SimpleRigidArray< Tsubscript, Mmax_dimen > | TIndexVec |
type of limit arrays (any sign) More... | |
typedef aff::util::StridedStepper | Tstepper |
type of stepper More... | |
Public Member Functions | |
Constructors | |
Strided () | |
construct and initialize to zero More... | |
Strided (const TSizeVec &sizes, const Tsubscript &first=1, const Tsubscript &shift=0) | |
construct do given size and first index More... | |
Strided (const TIndexVec &first, const TIndexVec &last, const Tsubscript &shift=0) | |
construct Fortran layout to given first and last index More... | |
Strided (const Tsize &s0, const Tsize &s1=1, const Tsize &s2=1, const Tsize &s3=1) | |
construct from given set of Fortran style sizes More... | |
Access to shape | |
Tsize | memory_size () const |
total size of mapped memory range More... | |
Tsize | size () const |
total number of mapped elements 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 Tsubscript & | last (const Tsubscript &i) const |
last index of dimension More... | |
Tsize | size (const Tsubscript &i) const |
size of dimension More... | |
const Tsize & | stride (const Tsubscript &i) const |
stride of dimension More... | |
const TIndexVec & | first () const |
return vector of first index values More... | |
const TIndexVec & | last () const |
return vector of last index values 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... | |
Static Public Attributes | |
static const Tdim | Mmax_dimen =4 |
instantiate static member (otherwise the linker won't find it) More... | |
Private Member Functions | |
void | calculate_base (const Tsubscript &offset) |
construct do given first and last index More... | |
void | setup_from_size (const TSizeVec &size, const Tsubscript &first=1, const Tsubscript &shift=0) |
setup to given size and first index More... | |
Private Attributes | |
TSizeVec | Mstride |
TIndexVec | Mfirst |
TIndexVec | Mlast |
TIndexVec | Mbase |
Shape for a rectangular array layout.
A rectangular array layout is the usual layout for multi-dimensional arrays. This is in contrast to packed layouts for banded matrices or triangular matrices that do not hold every array element.
A Strided shape typically is constrcuted through an aff::Shaper class.
if M is the number of index values passed to the access operator. In formula are the elements of
Mfirst
, are the elements of Mstride
, are the elements of Mbase
, and is Mbase
[0] (i.e. the first accessible position within the representation.