VIGRA - TemplateMultiIterator class Reference

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

| MultiIterator 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"`

## Public Types
typedef MultiIteratorBase< N >::template type< T, REFERENCE, POINTER > | base_type
typedef T | value_type
typedef REFERENCE | reference
typedef const value_type & | const_reference
typedef POINTER | pointer
typedef const value_type * | const_pointer
typedef ptrdiff_t | difference_type
typedef TinyVector< difference_type, N > | multi_difference_type
typedef base_type::next_type | next_type
typedef StridedMultiIterator< 1, T, REFERENCE, POINTER > | iterator
typedef base_type::iterator_category | iterator_category
## Public Methods
| MultiIterator ()
| MultiIterator (pointer ptr, const difference_type *stride, const difference_type *shape)
MultiIterator | operator+ (difference_type n) const
MultiIterator | operator+ (multi_difference_type const &d) const
difference_type | operator- (MultiIterator const &d) const
MultiIterator | operator- (difference_type n) const
MultiIterator | operator- (multi_difference_type const &d) const
template<unsigned int K> MultiIterator< K+1, T, REFERENCE, POINTER > & | dim ()

## Detailed Description

### template<unsigned int N, class T, class REFERENCE, class POINTER>
class vigra::MultiIterator< N, T, REFERENCE, POINTER >

A multi-dimensional hierarchical iterator to be used with vigra::MultiArrayView if it is not strided.

This class wraps the MultiIteratorBase in a template of arity two.

#include "vigra/multi_iterator.hxx"

Namespace: vigra

## Member Typedef Documentation

typedef MultiIteratorBase<N>::template type<T, REFERENCE, POINTER> base_type

| the type of the parent in the inheritance hierarchy. Reimplemented in type.

typedef const value_type* const_pointer

| const pointer type

typedef const value_type& const_reference

| const reference type (result of operator[] const)

typedef ptrdiff_t difference_type

| difference type (used for offsetting) Reimplemented in type.

typedef StridedMultiIterator<1, T, REFERENCE, POINTER> iterator

| the 1-dimensional iterator for this iterator hierarchy (result of iteratorForDimension()). Reimplemented in type.

typedef base_type::iterator_category iterator_category

| the iterator tag (image traverser) Reimplemented in type.

typedef TinyVector<difference_type, N> multi_difference_type

| multi difference type (used for offsetting along all axes simultaneously) Reimplemented in type.

typedef base_type::next_type next_type

| the MultiIterator for the next lower dimension. Reimplemented in type.

typedef POINTER pointer

| pointer type Reimplemented in type.

typedef REFERENCE reference

| reference type (result of operator[]) Reimplemented in type.

typedef T value_type

| the iterator's value type Reimplemented in type.

## Constructor & Destructor Documentation

MultiIterator | ( |  | ) | `[inline]`

| default constructor.

MultiIterator | ( | pointer | ptr,
|  | const difference_type * | stride,
|  | const difference_type * | shape
| ) | `[inline]`

| construct from pointer, strides (offset of a sample to the next) for every dimension, and the shape.

## Member Function Documentation

MultiIterator<K+1, T, REFERENCE, POINTER>& dim | ( |  | ) | `[inline]`

| Return the multi-iterator that operates on dimension K in order to manipulate this dimension directly. Usage:
                MultiIterator<3, int> i3 = ...;

                i3.template dim<2>()++;  // increment outer dimension
                i3.template dim<0>()++;  // increment inner dimension
For convenience, the same functionality is also available as `dim0()`, `dim1()` etc. up to `dim4()`:
                MultiIterator<3, int> i3 = ...;

                i3.dim2()++;  // increment outer dimension
                i3.dim0()++;  // increment inner dimension

MultiIterator operator+ | ( | multi_difference_type const & | d | ) | const`[inline]`

| addition along all dimensions

MultiIterator operator+ | ( | difference_type | n | ) | const`[inline]`

| addition within current dimension

MultiIterator operator- | ( | multi_difference_type const & | d | ) | const`[inline]`

| subtraction along all dimensions

MultiIterator operator- | ( | difference_type | n | ) | const`[inline]`

| subtraction within current dimension

difference_type operator- | ( | MultiIterator< N, T, REFERENCE, POINTER > const & | d | ) | const`[inline]`

| 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.

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

- vigra/multi_iterator.hxx

© Ullrich Köthe (koethe@informatik.uni-hamburg.de) Cognitive Systems Group, University of Hamburg, Germany | html generated using doxygen and Python VIGRA 1.5.0 (7 Dec 2006)