Dune::ContainerWrapperIterator< CW, T, R > Class Template Reference
[Dense Matrix and Vector Template Library]

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

#include <dune/common/diagonalmatrix.hh>

Inheritance diagram for Dune::ContainerWrapperIterator< CW, T, R >:
Dune::BidirectionalIteratorFacade< ContainerWrapperIterator< CW, T, R >, T, R, int > iterator

List of all members.

Public Types

typedef
ContainerWrapperIterator< CW,
T, R > 
DerivedType
 The type of derived iterator.
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

 ContainerWrapperIterator ()
 ContainerWrapperIterator (CW containerWrapper, int position)
template<class OtherContainerWrapperIteratorType >
 ContainerWrapperIterator (OtherContainerWrapperIteratorType &other)
 ContainerWrapperIterator (const MyType &other)
 ContainerWrapperIterator (const MyConstType &other)
template<class OtherContainerWrapperIteratorType >
ContainerWrapperIteratoroperator= (OtherContainerWrapperIteratorType &other)
T * operator-> () const
bool equals (const MyType &other) const
bool equals (const MyConstType &other) const
dereference () const
void increment ()
void decrement ()
elementAt (int i) const
void advance (int n)
template<class OtherContainerWrapperIteratorType >
std::ptrdiff_t distanceTo (OtherContainerWrapperIteratorType &other) const
std::ptrdiff_t index () const
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:
CW The container wrapper class
T The contained type
R The reference type returned by dereference

Member Typedef Documentation

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()

For an elaborate explanation see the STL Documentation

typedef int Dune::BidirectionalIteratorFacade< ContainerWrapperIterator< CW, T, R > , T , R , int >::DifferenceType [inherited]

The type of the difference between two positions.

typedef T * Dune::BidirectionalIteratorFacade< ContainerWrapperIterator< CW, T, R > , T , R , int >::Pointer [inherited]

The pointer to the Value.

typedef R Dune::BidirectionalIteratorFacade< ContainerWrapperIterator< CW, T, R > , T , R , int >::Reference [inherited]

The type of the reference to the values accessed.

typedef T Dune::BidirectionalIteratorFacade< ContainerWrapperIterator< CW, T, R > , T , R , int >::Value [inherited]

The type of value accessed through the iterator.


Constructor & Destructor Documentation

template<class CW , class T , class R >
Dune::ContainerWrapperIterator< CW, T, R >::ContainerWrapperIterator (  )  [inline]
template<class CW , class T , class R >
Dune::ContainerWrapperIterator< CW, T, R >::ContainerWrapperIterator ( CW  containerWrapper,
int  position 
) [inline]
template<class CW , class T , class R >
template<class OtherContainerWrapperIteratorType >
Dune::ContainerWrapperIterator< CW, T, R >::ContainerWrapperIterator ( OtherContainerWrapperIteratorType &  other  )  [inline]
template<class CW , class T , class R >
Dune::ContainerWrapperIterator< CW, T, R >::ContainerWrapperIterator ( const MyType other  )  [inline]
template<class CW , class T , class R >
Dune::ContainerWrapperIterator< CW, T, R >::ContainerWrapperIterator ( const MyConstType other  )  [inline]

Member Function Documentation

template<class CW , class T , class R >
void Dune::ContainerWrapperIterator< CW, T, R >::advance ( int  n  )  [inline]
template<class CW , class T , class R >
void Dune::ContainerWrapperIterator< CW, T, R >::decrement (  )  [inline]
template<class CW , class T , class R >
R Dune::ContainerWrapperIterator< CW, T, R >::dereference (  )  const [inline]
template<class CW , class T , class R >
template<class OtherContainerWrapperIteratorType >
std::ptrdiff_t Dune::ContainerWrapperIterator< CW, T, R >::distanceTo ( OtherContainerWrapperIteratorType &  other  )  const [inline]
template<class CW , class T , class R >
R Dune::ContainerWrapperIterator< CW, T, R >::elementAt ( int  i  )  const [inline]
template<class CW , class T , class R >
bool Dune::ContainerWrapperIterator< CW, T, R >::equals ( const MyConstType other  )  const [inline]
template<class CW , class T , class R >
bool Dune::ContainerWrapperIterator< CW, T, R >::equals ( const MyType other  )  const [inline]
template<class CW , class T , class R >
void Dune::ContainerWrapperIterator< CW, T, R >::increment (  )  [inline]
template<class CW , class T , class R >
std::ptrdiff_t Dune::ContainerWrapperIterator< CW, T, R >::index (  )  const [inline]
Reference Dune::BidirectionalIteratorFacade< ContainerWrapperIterator< CW, T, R > , T , R , int >::operator* (  )  const [inline, inherited]

Dereferencing operator.

DerivedType Dune::BidirectionalIteratorFacade< ContainerWrapperIterator< CW, T, R > , T , R , int >::operator++ ( int   )  [inline, inherited]

Postincrement operator.

DerivedType& Dune::BidirectionalIteratorFacade< ContainerWrapperIterator< CW, T, R > , T , R , int >::operator++ (  )  [inline, inherited]

Preincrement operator.

DerivedType Dune::BidirectionalIteratorFacade< ContainerWrapperIterator< CW, T, R > , T , R , int >::operator-- ( int   )  [inline, inherited]

Postincrement operator.

DerivedType& Dune::BidirectionalIteratorFacade< ContainerWrapperIterator< CW, T, R > , T , R , int >::operator-- (  )  [inline, inherited]

Preincrement operator.

template<class CW , class T , class R >
T* Dune::ContainerWrapperIterator< CW, T, R >::operator-> (  )  const [inline]
template<class CW , class T , class R >
template<class OtherContainerWrapperIteratorType >
ContainerWrapperIterator& Dune::ContainerWrapperIterator< CW, T, R >::operator= ( OtherContainerWrapperIteratorType &  other  )  [inline]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 25 Mar 2018 for dune-common by  doxygen 1.6.1