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

◆ size() [1/2]

Tsize aff::Strided::size ( ) const

total number of mapped elements

calculate total size

Examples:
tests/shapetest.cc.

Definition at line 140 of file strided.cc.

References aff::inline_product(), Mfirst, Mlast, and Mmax_dimen.

Referenced by collapse(), aff::dump(), aff::util::is_dense_1D_array(), setup_from_size(), Strided(), and aff::util::StridedStepper::StridedStepper().

141  {
142  // could be done more elegant by inlining - but this will do it here
144  for (int i=0; i<Mmax_dimen; i++) { size[i]-=(Mfirst[i]-1); }
145  return (inline_product(size));
146  }
TIndexVec Mlast
Definition: strided.h:288
T inline_product(const SimpleRigidArray< T, N > &array)
Product of all elements.
Definition: simplearray.h:178
static const Tdim Mmax_dimen
instantiate static member (otherwise the linker won&#39;t find it)
Definition: strided.h:123
SimpleRigidArray< Tsize, Mmax_dimen > TSizeVec
type of size and stride array (always positive)
Definition: strided.h:126
Tsize size() const
total number of mapped elements
Definition: strided.cc:140
TIndexVec Mfirst
Definition: strided.h:287
Here is the call graph for this function:
Here is the caller graph for this function: