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

◆ decr()

StridedStepper & aff::util::StridedStepper::decr ( )

decrement offset - return reference to itself

previous position

Definition at line 91 of file stridedstepper.cc.

References aff::Strided::first(), aff::Strided::last(), less(), Mcarry, Mcurrent, Mindex, aff::Strided::Mmax_dimen, Mshape, Mvalid, and aff::Strided::stride().

Referenced by steppers().

92  {
93  if (!this->less()) Mvalid=false;
94  Tsubscript i=0;
95  while (i<Tshape::Mmax_dimen)
96  {
97  --Mindex[i];
99  if (Mindex[i]<Mshape.first(i))
100  {
101  Mindex[i]=Mshape.last(i);
102  Mcurrent+=Mcarry[i];
103  ++i;
104  }
105  else
106  {
108  }
109  }
110  return(*this);
111  }
Tsubscript Mcurrent
hold current position offset to memory
const Tsubscript & first(const Tsubscript &i) const
first index of dimension
Definition: strided.h:194
const Tsize & stride(const Tsubscript &i) const
stride of dimension
Definition: strided.h:203
static const Tdim Mmax_dimen
instantiate static member (otherwise the linker won&#39;t find it)
Definition: strided.h:123
TIndexVec Mindex
hold current index vector
TSizeVec Mcarry
hold carry values
ptrdiff_t Tsubscript
Type to hold an array&#39;s subscript value.
Definition: types.h:53
bool less() const
returns true if there are more elements in decr-direction
const Tshape & Mshape
hold reference to shape
const Tsubscript & last(const Tsubscript &i) const
last index of dimension
Definition: strided.h:197
Here is the call graph for this function:
Here is the caller graph for this function: