[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]
MultiArrayNavigator< MULTI_ITERATOR, N > Class Template Reference |
A navigator that provides access to the 1D subranges of an n-dimensional range given by a vigra::MultiIterator and an nD shape. More...
#include <vigra/navigator.hxx>
Public Types | |
typedef MULTI_ITERATOR::iterator | iterator |
typedef MULTI_ITERATOR::multi_difference_type | shape_type |
Public Member Functions | |
bool | atEnd () const |
bool | hasMore () const |
MultiArrayNavigator (MULTI_ITERATOR const &i, shape_type const &shape, unsigned int inner_dimension) | |
void | operator++ () |
void | operator++ (int) |
A navigator that provides access to the 1D subranges of an n-dimensional range given by a vigra::MultiIterator and an nD shape.
Normally, the innermost loop of an iteration extends over the innermost dimension of a given array. Sometimes, however, it is necessary to have some other dimension in the inner loop. For example, instead of iterating over the rows, the inner loop should extend over the columns. The class MultiArrayNavigator encapsulates the necessary functionality. Given an arbitrary dimensional array (represented by a vigra::MultiIterator/shape pair), and the desired inner loop dimension d
, it moves the encapsulated iterator to all possible starting points of 1D subsets along the given dimension (e.g. all columns). By calling begin()
and end()
, one can then obtain an STL-compatible 1-dimensional iterator for the current subset.
The template parameters specify the embedded iterator type and its dimension.
Usage:
#include <vigra/navigator.hxx>
Namespace: vigra
typedef MULTI_ITERATOR::multi_difference_type shape_type |
The required shape type for the given iterator type.
typedef MULTI_ITERATOR::iterator iterator |
The iterator type for the inner loop (result of begin() and end()).
MultiArrayNavigator | ( | MULTI_ITERATOR const & | i, |
shape_type const & | shape, | ||
unsigned int | inner_dimension | ||
) |
Construct navigator for multi-dimensional iterator i
, array shape shape
and inner loop dimension inner_dimension
.
void operator++ | ( | ) |
Advance to next starting location.
void operator++ | ( | int | ) |
Advance to next starting location.
bool hasMore | ( | ) | const |
true if there are more elements.
bool atEnd | ( | ) | const |
true if iterator is exhausted.
© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) |
html generated using doxygen and Python
|