slice
- Todo:
- This is implementation of slicing is straightforward but rather inefficient. If you do a lot of slicing it might be worth to review and rework the code.
Definition at line 224 of file strided.cc.
References AFF_assert, calculate_base(), first_offset(), Mfirst, Mlast, Mmax_dimen, Mstride, offset(), shrink(), and size().
227 "ERROR (Strided::collapse): illegal dimension");
229 "ERROR (Strided::collapse): index range error");
230 this->
shrink(i,index,index);
static const Tdim Mmax_dimen
instantiate static member (otherwise the linker won't find it)
#define AFF_assert(C, M)
Check an assertion and report by throwing an exception.
void calculate_base(const Tsubscript &offset)
construct do given first and last index
Tsize size() const
total number of mapped elements
Tsubscript first_offset() const
first mapped position
unsigned short int Tdim
Type to hold an array dimensionality.
ptrdiff_t Tsubscript
Type to hold an array's subscript value.
Tsubscript offset(const TIndexVec &index) const
full dimensionality access
Strided & shrink(const TIndexVec &last)
subarray