[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]
MultiIterator< N, T, REFERENCE, POINTER > Class Template Reference |
A multi-dimensional hierarchical iterator to be used with vigra::MultiArrayView if it is not strided. More...
#include <vigra/multi_iterator.hxx>
Inherited by CombinedMultiIterator< N, T >, and CoordinateMultiIterator< N >.
Public Types | |
enum | |
typedef MultiIterator< N-1, T, REFERENCE, POINTER > | base_type |
typedef const value_type * | const_pointer |
typedef const value_type & | const_reference |
typedef MultiArrayIndex | difference_type |
typedef StridedMultiIterator < 1, T, REFERENCE, POINTER > | iterator |
typedef multi_dimensional_traverser_tag | iterator_category |
typedef MultiArrayShape< N >::type | multi_difference_type |
typedef base_type | next_type |
typedef POINTER | pointer |
typedef REFERENCE | reference |
typedef T | value_type |
A multi-dimensional hierarchical iterator to be used with vigra::MultiArrayView if it is not strided.
See Multi-dimensional Array Iterators for further documentation.
#include <vigra/multi_iterator.hxx>
Namespace: vigra
typedef MultiIterator<N-1, T, REFERENCE, POINTER> base_type |
the type of the parent in the inheritance hierarchy.
typedef T value_type |
the iterator's value type
typedef REFERENCE reference |
reference type (result of operator[])
typedef const value_type& const_reference |
const reference type (result of operator[] const)
typedef POINTER pointer |
pointer type
typedef const value_type* const_pointer |
const pointer type
typedef MultiArrayShape<N>::type multi_difference_type |
multi difference type (used for offsetting along all axes simultaneously)
typedef MultiArrayIndex difference_type |
difference type (used for offsetting)
the MultiIterator for the next lower dimension.
typedef StridedMultiIterator<1, T, REFERENCE, POINTER> iterator |
the 1-dimensional iterator for this iterator hierarchy (result of iteratorForDimension()).
typedef multi_dimensional_traverser_tag iterator_category |
the iterator tag (image traverser)
anonymous enum |
the iterator's level in the dimension hierarchy
MultiIterator | ( | ) |
default constructor.
MultiIterator | ( | pointer | ptr, |
const difference_array_type & | stride, | ||
const shape_array_type & | shape | ||
) |
construct from pointer, strides (offset of a sample to the next) for every dimension, and the shape.
void operator++ | ( | ) |
prefix-increment the iterator in its current dimension
void operator-- | ( | ) |
prefix-decrement the iterator in its current dimension
MultiIterator operator++ | ( | int | ) |
postfix-increment the iterator in its current dimension
MultiIterator operator-- | ( | int | ) |
postfix-decrement the iterator in its current dimension
MultiIterator& operator+= | ( | difference_type | n | ) |
increment the iterator in its current dimension by the given value.
MultiIterator& operator+= | ( | multi_difference_type const & | d | ) |
increment the iterator in all dimensions by the given offset.
MultiIterator& operator-= | ( | difference_type | n | ) |
decrement the iterator in its current dimension by the given value.
MultiIterator& operator-= | ( | multi_difference_type const & | d | ) |
decrement the iterator in all dimensions by the given offset.
MultiIterator operator+ | ( | difference_type | n | ) | const |
addition within current dimension
MultiIterator operator+ | ( | multi_difference_type const & | d | ) | const |
addition along all dimensions
difference_type operator- | ( | MultiIterator< N, T, REFERENCE, POINTER > const & | d | ) | const |
difference of two iterators in the current dimension. The result of this operation is undefined if the iterator doesn't point to element 0 in all dimensions below its current dimension.
MultiIterator operator- | ( | difference_type | n | ) | const |
subtraction within current dimension
MultiIterator operator- | ( | multi_difference_type const & | d | ) | const |
subtraction along all dimensions
reference operator* | ( | ) | const |
derefenrence item
pointer get | ( | ) | const |
get address of current item
pointer operator-> | ( | ) | const |
call method of current item
bool operator!= | ( | const MultiIterator< N, T, REFERENCE, POINTER > & | rhs | ) | const |
inequality. True if iterators reference different items.
bool operator== | ( | const MultiIterator< N, T, REFERENCE, POINTER > & | rhs | ) | const |
equality. True if iterators reference the same items.
bool operator< | ( | const MultiIterator< N, T, REFERENCE, POINTER > & | rhs | ) | const |
less than.
bool operator<= | ( | const MultiIterator< N, T, REFERENCE, POINTER > & | rhs | ) | const |
less or equal.
bool operator> | ( | const MultiIterator< N, T, REFERENCE, POINTER > & | rhs | ) | const |
greater than.
bool operator>= | ( | const MultiIterator< N, T, REFERENCE, POINTER > & | rhs | ) | const |
greater or equal.
reference operator[] | ( | difference_type | n | ) | const |
access the array element at the given offset in the current dimension.
reference operator[] | ( | multi_difference_type const & | d | ) | const |
access the array element at the given offset.
next_type begin | ( | ) | const |
Return the (N-1)-dimensional multi-iterator that points to the first (N-1)-dimensional subarray of the N-dimensional array this iterator is referring to. The result is only valid if this iterator refers to location 0 in all dimensions below its current dimension N, otherwise it is undefined. Usage:
next_type end | ( | ) | const |
Return the (N-1)-dimensional multi-iterator that points beyond the last (N-1)-dimensional subarray of the N-dimensional array this iterator is referring to. The result is only valid if this iterator refers to location 0 in all dimensions below its current dimension N, otherwise it is undefined.
iterator iteratorForDimension | ( | unsigned int | d | ) | const |
Get a 1-dimensional, STL-compatible iterator for the given dimension, pointing to the current element of this
. Usage:
MultiIterator<K+1, T, REFERENCE, POINTER>& dim | ( | ) |
Return the multi-iterator that operates on dimension K in order to manipulate this dimension directly. Usage:
For convenience, the same functionality is also available as dim0()
, dim1()
etc. up to dim4()
:
© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) |
html generated using doxygen and Python
|