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

◆ incr()

StridedStepper & aff::util::StridedStepper::incr ( )

increment offset - return reference to itself

next position

Definition at line 66 of file stridedstepper.cc.

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

Referenced by aff::Array< T >::operator=().

67  {
68  if (!this->more()) Mvalid=false;
69  Tsubscript i=0;
70  while (i<Tshape::Mmax_dimen)
71  {
72  ++Mindex[i];
74  if (Mindex[i]>Mshape.last(i))
75  {
76  Mindex[i]=Mshape.first(i);
77  Mcurrent-=Mcarry[i];
78  ++i;
79  }
80  else
81  {
83  }
84  }
85  return(*this);
86  }
Tsubscript Mcurrent
hold current position offset to memory
bool more() const
returns true if there are more elements in incr-direction
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
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: