AFF --- A container for numbers (array) by Friederich and Forbriger.

◆ shrink() [2/4]

Strided & aff::Strided::shrink ( const TIndexVec first,
const TIndexVec last 
)

subarray

Definition at line 164 of file strided.cc.

References AFF_assert, calculate_base(), first(), aff::inline_anylarger(), aff::inline_anysmaller(), last(), Mfirst, Mlast, and offset().

165  {
168  "ERROR (Strided::shrink): illegal last index vector");
171  "ERROR (Strided::shrink): illegal first index vector");
173  "ERROR (Strided::shrink): last must not be smaller than first");
174  Tsubscript offset=this->offset(first);
175  Mfirst=first;
176  Mlast=last;
177  this->calculate_base(offset);
178  return(*this);
179  }
TIndexVec Mlast
Definition: strided.h:288
const TIndexVec & first() const
return vector of first index values
Definition: strided.h:206
bool inline_anysmaller(const SimpleRigidArray< T, N > &A, const SimpleRigidArray< T, N > &B)
Returns true if any of A is smaller than corresponding B.
Definition: simplearray.h:188
bool inline_anylarger(const SimpleRigidArray< T, N > &A, const SimpleRigidArray< T, N > &B)
Returns true if any of A is larger than corresponding B.
Definition: simplearray.h:194
#define AFF_assert(C, M)
Check an assertion and report by throwing an exception.
Definition: error.h:162
void calculate_base(const Tsubscript &offset)
construct do given first and last index
Definition: strided.cc:128
const TIndexVec & last() const
return vector of last index values
Definition: strided.h:208
ptrdiff_t Tsubscript
Type to hold an array&#39;s subscript value.
Definition: types.h:53
TIndexVec Mfirst
Definition: strided.h:287
Tsubscript offset(const TIndexVec &index) const
full dimensionality access
Definition: strided.h:220
Here is the call graph for this function: