Dune Core Modules (unstable)

Iterator class for sparse vector-like containers. More...

#include <dune/common/diagonalmatrix.hh>

Public Types

typedef ContainerWrapperIterator< CW, T, R > DerivedType
 The type of derived iterator. More...
 
typedef T Value
 The type of value accessed through the iterator.
 
typedef T * Pointer
 The pointer to the Value.
 
typedef int DifferenceType
 The type of the difference between two positions.
 
typedef R Reference
 The type of the reference to the values accessed.
 

Public Member Functions

Reference operator* () const
 Dereferencing operator.
 
DerivedTypeoperator++ ()
 Preincrement operator.
 
DerivedType operator++ (int)
 Postincrement operator.
 
DerivedTypeoperator-- ()
 Preincrement operator.
 
DerivedType operator-- (int)
 Postincrement operator.
 

Detailed Description

template<class CW, class T, class R>
class Dune::ContainerWrapperIterator< CW, T, R >

Iterator class for sparse vector-like containers.

This class provides an iterator for sparse vector like containers. It contains a ContainerWrapper that must provide the translation from the position in the underlying container to the index in the sparse container.

The ContainerWrapper must be default and copy-constructable. Furthermore it must provide the methods:

bool identical(other) - check if this is identical to other (same container, not only equal) T* pointer(position) - get pointer to data at position in underlying container size_t realIndex(position) - get index in sparse container for position in underlying container

Notice that the iterator stores a ContainerWrapper. This allows one to use proxy classes as underlying container and as returned reference type.

Template Parameters
CWThe container wrapper class
TThe contained type
RThe reference type returned by dereference

Member Typedef Documentation

◆ DerivedType

typedef ContainerWrapperIterator< CW, T, R > Dune::BidirectionalIteratorFacade< ContainerWrapperIterator< CW, T, R > , T , R, int >::DerivedType
inherited

The type of derived iterator.

The iterator has to define following functions have to be present:

// Access the value referred to.
Reference dereference() const;
// Compare for equality with j
bool equals(j);
// position the iterator at the next element.
void increment()
// position the iterator at the previous element.
void decrement()
R Reference
The type of the reference to the values accessed.
Definition: iteratorfacades.hh:329

For an elaborate explanation see the STL Documentation


The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (Apr 18, 22:30, 2024)