[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]

List of all members
MultiCoordinateIterator< N > Class Template Reference

Iterate over a virtual array where each element contains its coordinate. More...

`#include <vigra/multi_iterator.hxx>`

Inheritance diagram for MultiCoordinateIterator< N >:

## Additional Inherited Members

Public Types inherited from CoupledScanOrderIterator< N >
typedef HANDLES | value_type
Public Member Functions inherited from CoupledScanOrderIterator< N >
CoupledHandleCast< TARGET_INDEX, value_type >::type::reference | get ()
CoupledHandleCast< TARGET_INDEX, value_type >::type::const_reference | get () const
CoupledScanOrderIterator | getEndIterator () const

## Detailed Description

template<unsigned int N>
class vigra::MultiCoordinateIterator< N >

Iterate over a virtual array where each element contains its coordinate.

MultiCoordinateIterator behaves like a read-only random access iterator. It moves accross the given region of interest in scan-order (with the first index changing most rapidly), and dereferencing the iterator returns the coordinate (i.e. multi-dimensional index) of the current array element. The functionality is thus similar to a meshgrid in Matlab or numpy.

Internally, it is just a wrapper of a CoupledScanOrderIterator that has been created without any array and whose reference type is not a CoupledHandle, but the coordinate itself.

The iterator supports all functions listed in the STL documentation for Random Access Iterators.

Usage:

#include <vigra/multi_iterator.hxx>
Namespace: vigra

MultiCoordinateIterator<3> i(Shape3(3,2,1)), end = i.getEndIterator();
for(; i != end; ++i)
std::cout << *i << "\n";
// Output:
// (0, 0, 0)
// (1, 0, 0)
// (2, 0, 0)
// (0, 1, 0)
// (1, 1, 0)
// (2, 1, 0)

The documentation for this class was generated from the following files:

- vigra/multi_fwd.hxx
- vigra/multi_iterator.hxx

© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) Heidelberg Collaboratory for Image Processing, University of Heidelberg, Germany | html generated using doxygen and Python vigra 1.12.4