68 #ifndef AFF_STRIDED_H_VERSION 70 #define AFF_STRIDED_H_VERSION \ 198 {
return (
Mlast[i]); }
201 {
return (static_cast<Tsize>(
Mlast[i]-
Mfirst[i]+1)); }
310 #endif // AFF_STRIDED_H_VERSION (includeguard)
Root namespace of library.
Shape for a rectangular array layout.
some typedefs we refer to
aff::util::StridedStepper Tstepper
type of stepper
Strided(const TSizeVec &sizes, const Tsubscript &first=1, const Tsubscript &shift=0)
construct do given size and first index
Tsubscript offset(const Tsubscript &i0, const Tsubscript &i1, const Tsubscript &i2, const Tsubscript &i3) const
offset from 4 index values
bool is_dense_1D_array(const aff::Strided &shape)
check whether array shape describes a 1D array with dense layout in the memory.
Tsize size(const Tsubscript &i) const
size of dimension
const TIndexVec & first() const
return vector of first index values
Tsubscript last_offset() const
last mapped position
void setup_from_size(const TSizeVec &size, const Tsubscript &first=1, const Tsubscript &shift=0)
setup to given size and first index
Strided & setfirst(const Tdim &i, const Tsubscript &index)
setfirst
Strided & shift(const Tdim &i, const Tsubscript &index)
shift
Tsubscript offset(const Tsubscript &i0, const Tsubscript &i1) const
offset from 2 index values
Strided & collapse(const Tdim &i, const Tsubscript &index)
slice
const Tsubscript & first(const Tsubscript &i) const
first index of dimension
const Tsize & stride(const Tsubscript &i) const
stride of dimension
static const Tdim Mmax_dimen
instantiate static member (otherwise the linker won't find it)
SimpleRigidArray< Tsize, Mmax_dimen > TSizeVec
type of size and stride array (always positive)
Tsubscript offset(const Tsubscript &i0, const Tsubscript &i1, const Tsubscript &i2) const
offset from 3 index values
Strided()
construct and initialize to zero
Tsize memory_size() const
total size of mapped memory range
void calculate_base(const Tsubscript &offset)
construct do given first and last index
Tsize size() const
total number of mapped elements
const TIndexVec & last() const
return vector of last index values
Tsubscript first_offset() const
first mapped position
unsigned short int Tdim
Type to hold an array dimensionality.
T inline_innerproduct(const SimpleRigidArray< T, N > &A, const SimpleRigidArray< T, N > &B)
Returns inner product.
A stepper for all strided shapes.
ptrdiff_t Tsubscript
Type to hold an array's subscript value.
Tsubscript offset(const Tsubscript &i0) const
offset from 1 index value
SimpleRigidArray< Tsubscript, Mmax_dimen > TIndexVec
type of limit arrays (any sign)
const Tsubscript & last(const Tsubscript &i) const
last index of dimension
Tsubscript offset(const TIndexVec &index) const
full dimensionality access
Strided & shrink(const TIndexVec &last)
subarray
size_t Tsize
Type to hold the size of an array dimension.
const TSizeVec & stride() const
return vector of stride values