#include <vctVarStrideMatrixIterator.h>
template<class _elementType>
class vctVarStrideMatrixConstIterator< _elementType >
- Parameters
-
_elementType | the type of the element that the iterator refers to. |
- See Also
- vctVarStrideMatrixIterator
template<class _elementType>
Base type for this iterator, i.e. std::iterator.
template<class _elementType>
Type (i.e. category) of iterator, i.e. std::random_access_iterator_tag.
template<class _elementType>
The type of the iterator itself.
template<class _elementType>
Default constructor: create an uninitialized object.
template<class _elementType>
Constructor taking a non-const element pointer. Note that only read operations will be performed!
template<class _elementType>
Constructor taking a const element pointer. We need it in order to deal with const containers being refered by this iterator. We have to perform const_cast to convert back to the stored non-const member pointer of this iterator. However, the non-const iterator class completely shadows the constructors of the const-iterator base class, and so we don't have to worry about creating a non-const iterator over a const container.
template<class _elementType>
Complementary operation to operator ==.
template<class _elementType>
template<class _elementType>
template<class _elementType>
template<class _elementType>
Increment by offset.
- Parameters
-
difference | offset to increment by |
template<class _elementType>
Subtraction between iterators returns the number of increments needed for the second operand to reach the first operand, if it is reachable.
The number of increments is found by the following equations: DataPtr - (difference / NumColumns) * RowStride + (difference % NumColumns) * ColumnStride == other.DataPtr DataPtr - other.DataPtr == (difference / NumColumns) * RowStride + (difference % NumColumns) * ColumnStride
if (RowStride >= NumColumns * ColumnStride) { (DataPtr - other.DataPtr) / RowStride == row_diff == (difference / NumColumns) DataPtr - other.DataPtr - row_diff * RowStride == (difference % NumColumns) * ColumnStride (DataPtr - other.DataPtr - row_diff * RowStride) / ColumnStride == col_diff == (difference % NumColumns) difference == row_diff * NumColumns + col_diff } otherwise switch the roles of rows and columns.
- Note
- this operation assumes reachability and does not test for it.
template<class _elementType>
template<class _elementType>
template<class _elementType>
Decrement by offset.
- Parameters
-
difference | offset to decrement by |
template<class _elementType>
Order relation between iterators, required by STL.
- Note
- The STL manual states that "if j is reachable from i then
i<j". This does not imply the converse: "if i<j then j is
reachable from i". In the case here, the converse does not hold.
template<class _elementType>
template<class _elementType>
Equality of iterators, required by STL.
template<class _elementType>
Complementary operation to operator <.
template<class _elementType>
template<class _elementType>
Random access (return const reference).
template<class _elementType>
template<class _elementType>
An auxiliary method to wrap the column index of the iterator. If the current column is negative, move one row up, and wrap to the corresponding column starting from the right
template<class _elementType>
An auxiliary method to wrap the column index of the iterator. If the current column exceeds the number of columns in the matrix, more one row down and wrap to the corresponding column starting from the left
template<class _elementType>
template<class _elementType>
template<class _elementType>
The data member points to the object being refered by this iterator. It is not declared const, so we will be able to use it in the non-const iterator class. But all the methods in vctVarStrideMatrixConstIterator are declared const to protect the data from writing.
template<class _elementType>
template<class _elementType>
The documentation for this class was generated from the following file: