iterator
for a given ltl::MArray. This will rarely be called by a user. end-iterator
for a given ltl::MArray. This will rarely be called by a user. operator++()
. typedef std::forward_iterator_tag ltl::MArrayIterConst< T, N >::iterator_category |
std::iterator
typedefs
typedef int ltl::MArrayIterConst< T, N >::difference_type |
typedef MArray<T,N>::value_type ltl::MArrayIterConst< T, N >::value_type |
typedef MArray<T,N>::const_reference ltl::MArrayIterConst< T, N >::const_reference |
typedef MArray<T,N>::const_pointer ltl::MArrayIterConst< T, N >::const_pointer |
typedef MArray<T,N>::reference ltl::MArrayIterConst< T, N >::reference |
typedef MArray<T,N>::pointer ltl::MArrayIterConst< T, N >::pointer |
anonymous enum |
ltl::MArrayIterConst< T, N >::MArrayIterConst | ( | const MArray< T, N > & | array | ) | [inline] |
Construct an iterator
for a given ltl::MArray. This will rarely be called by a user.
DOXYGEN_IGNORE The constructor implementation.
ltl::MArrayIterConst< T, N >::MArrayIterConst | ( | const MArray< T, N > & | array, | |
const _iter_end_tag & | E | |||
) | [inline] |
Construct an end-iterator
for a given ltl::MArray. This will rarely be called by a user.
ltl::MArrayIterConst< T, N >::MArrayIterConst | ( | const MArrayIterConst< T, N > & | other | ) | [inline] |
copy constructor
void ltl::MArrayIterConst< T, N >::reset | ( | ) | [inline] |
Reset the iterator back to the first element.
Reset the iterator (back to first element).
value_type ltl::MArrayIterConst< T, N >::operator * | ( | ) | const [inline] |
Dereference the iterator object. Return the element pointed to.
MArrayIterConst<T,N>& ltl::MArrayIterConst< T, N >::operator++ | ( | ) | [inline] |
Move the iterator to the next object.
This method will almost never be used. Instead, more efficient versions will be used by the expression template engine to move iterators forward.
This implementation of operator++()
will check for the end condition every time it is called. When we evaluate an expression, all iterators involved in the expression point to MArrays or expressions of the same geometry, so checking for the end condition on ONE of the iterators is enough. We also know the length of the dimension(s), so we can optimize the increment past the end of one dimension (where we have to reset this dimension and use a different stride to increment the next-outer dimension). See below and implementation of evaluation methods in ltl/marray/eval.h.
Reimplemented in ltl::MArrayIter< T, N >.
void ltl::MArrayIterConst< T, N >::operator++ | ( | int | ) | [inline] |
Postfix operator++()
.
void ltl::MArrayIterConst< T, N >::advance | ( | ) | [inline] |
Provide separate versions of advance() for incrementing the innermost.
When evaluating an expression involving more than one iterator all terms MUST have the same geometry, the loop structures are identical. It's therefore sufficient to check the end of loop condition and the end of one dimension on one of the iterators ... All others are then 'remote controlled' via these methods methods. See implementation of evaluation methods in ltl/marray/eval.h. Unconditionally increase the data pointer by one innermost stride.
void ltl::MArrayIterConst< T, N >::advanceN | ( | int | n | ) | [inline] |
Unconditionally increase the data pointer by N innermost strides.
void ltl::MArrayIterConst< T, N >::advanceN | ( | int | n, | |
int | dim | |||
) | [inline] |
Unconditionally increase the data pointer by N along dimension dim (used for partial reductions).
void ltl::MArrayIterConst< T, N >::advanceWithStride1 | ( | ) | [inline] |
Unconditionally increase the data pointer by one.
bool ltl::MArrayIterConst< T, N >::needAdvanceDim | ( | ) | const [inline] |
Check if we have reached the end of the innermost dimension.
void ltl::MArrayIterConst< T, N >::advanceDim | ( | ) | [inline] |
Advance the iterator past the end of one "line" (the end of the innermost dimension).
Reset stacks after we've hit the end of a dimension.
void ltl::MArrayIterConst< T, N >::advanceDim | ( | const int | cutDim | ) | [inline] |
Advance the iterator past the end of one "line", ignoring the dimension cutDim (used in partial reductions).
Reset stacks after we've hit the end of a dimension. Ignore dimension cutDim
used in partial reductions.
value_type ltl::MArrayIterConst< T, N >::readWithoutStride | ( | const int | i | ) | const [inline] |
Read the data value at the current location + i (optimized for stride 1).
These methods are for implementing loop unrolling and vectorization for the efficient evaluation of expression templates.
value_type ltl::MArrayIterConst< T, N >::readWithStride | ( | const int | i | ) | const [inline] |
Read the current data value at the current location + i*stride.
value_type ltl::MArrayIterConst< T, N >::readWithStride | ( | const int | i, | |
const int | dim | |||
) | const [inline] |
Read the data value at position i along dimension dim (used in partial reductions).
bool ltl::MArrayIterConst< T, N >::operator== | ( | const MArrayIterConst< T, N > & | other | ) | const [inline] |
true
if iterators share the same data pointer
bool ltl::MArrayIterConst< T, N >::operator!= | ( | const MArrayIterConst< T, N > & | other | ) | const [inline] |
true
if iterators do not share the same data pointer
bool ltl::MArrayIterConst< T, N >::done | ( | ) | const [inline] |
True if we point past the end, i.e. we are equal to the end iterator.
bool ltl::MArrayIterConst< T, N >::isConformable | ( | const Shape< N > & | other | ) | const [inline] |
true
if we have the same array geometry as that of other
,
void ltl::MArrayIterConst< T, N >::printRanges | ( | ) | const [inline] |
Pretty print the geometry.
const Shape<N>* ltl::MArrayIterConst< T, N >::shape | ( | ) | const [inline] |
Return our shape
.
bool ltl::MArrayIterConst< T, N >::isStorageContiguous | ( | ) | const [inline] |
true
if the memory we are pointing to has contiguous memory layout.
bool ltl::MArrayIterConst< T, N >::isStride1 | ( | ) | const [inline] |
true
if our innermost stride is 1
value_type* ltl::MArrayIterConst< T, N >::data | ( | ) | const [inline] |
Return the current data pointer.
value_type* __restrict__ ltl::MArrayIterConst< T, N >::data_ [protected] |
value_type* __restrict__ ltl::MArrayIterConst< T, N >::first_ [protected] |
value_type* ltl::MArrayIterConst< T, N >::stack_[N] [protected] |
value_type * ltl::MArrayIterConst< T, N >::last_[N] [protected] |
int ltl::MArrayIterConst< T, N >::strides_[N] [protected] |
int ltl::MArrayIterConst< T, N >::length_[N] [protected] |
const int ltl::MArrayIterConst< T, N >::stride_ [protected] |
const Shape<N>* ltl::MArrayIterConst< T, N >::shape_ [protected] |