dune-common  2.5.0
Public Types | Public Member Functions | List of all members
Dune::DenseIterator< C, T, R > Class Template Reference

Generic iterator class for dense vector and matrix implementations. More...

#include <dune/common/densevector.hh>

Inheritance diagram for Dune::DenseIterator< C, T, R >:
Inheritance graph

Public Types

typedef std::ptrdiff_t DifferenceType
 The type of the difference between two positions. More...
 
typedef C::size_type SizeType
 The type to index the underlying container. More...
 
typedef DenseIterator< C, T, R > DerivedType
 The type of derived iterator. More...
 
typedef T Value
 The type of value accessed through the iterator. More...
 
typedef T * Pointer
 The pointer to the Value. More...
 
typedef R Reference
 The type of the reference to the values accessed. More...
 

Public Member Functions

 DenseIterator ()
 
 DenseIterator (C &cont, SizeType pos)
 
 DenseIterator (const MutableIterator &other)
 
 DenseIterator (const ConstIterator &other)
 
bool equals (const MutableIterator &other) const
 
bool equals (const ConstIterator &other) const
 
dereference () const
 
void increment ()
 
void decrement ()
 
elementAt (DifferenceType i) const
 
void advance (DifferenceType n)
 
DifferenceType distanceTo (DenseIterator< const typename std::remove_const< C >::type, const typename std::remove_const< T >::type > other) const
 
DifferenceType distanceTo (DenseIterator< typename std::remove_const< C >::type, typename std::remove_const< T >::type > other) const
 
SizeType index () const
 return index More...
 
Reference operator* () const
 Dereferencing operator. More...
 
Pointer operator-> () const
 
Reference operator[] (DifferenceType n) const
 Get the element n positions from the current one. More...
 
DerivedTypeoperator++ ()
 Preincrement operator. More...
 
DerivedType operator++ (int)
 Postincrement operator. More...
 
DerivedTypeoperator+= (DifferenceType n)
 
DerivedType operator+ (DifferenceType n) const
 
DerivedTypeoperator-- ()
 Predecrement operator. More...
 
DerivedType operator-- (int)
 Postdecrement operator. More...
 
DerivedTypeoperator-= (DifferenceType n)
 
DerivedType operator- (DifferenceType n) const
 

Detailed Description

template<class C, class T, class R = T&>
class Dune::DenseIterator< C, T, R >

Generic iterator class for dense vector and matrix implementations.

provides sequential access to DenseVector, FieldVector and FieldMatrix

Member Typedef Documentation

§ DerivedType

typedef DenseIterator< C, T, R > Dune::RandomAccessIteratorFacade< DenseIterator< C, T, R > , T , R, std::ptrdiff_t >::DerivedType
inherited

The type of derived iterator.

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

// Access the value referred to.
// Access the value at some other location
// 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()
// advance the iterator by a number of positions-
// calculate the distance to another iterator.
// One should incorporate an assertion whether
// the same containers are referenced

For an elaborate explanation see the STL Documentation

§ DifferenceType

template<class C , class T , class R = T&>
typedef std::ptrdiff_t Dune::DenseIterator< C, T, R >::DifferenceType

The type of the difference between two positions.

§ Pointer

typedef T * Dune::RandomAccessIteratorFacade< DenseIterator< C, T, R > , T , R, std::ptrdiff_t >::Pointer
inherited

The pointer to the Value.

§ Reference

typedef R Dune::RandomAccessIteratorFacade< DenseIterator< C, T, R > , T , R, std::ptrdiff_t >::Reference
inherited

The type of the reference to the values accessed.

§ SizeType

template<class C , class T , class R = T&>
typedef C::size_type Dune::DenseIterator< C, T, R >::SizeType

The type to index the underlying container.

§ Value

typedef T Dune::RandomAccessIteratorFacade< DenseIterator< C, T, R > , T , R, std::ptrdiff_t >::Value
inherited

The type of value accessed through the iterator.

Constructor & Destructor Documentation

§ DenseIterator() [1/4]

template<class C , class T , class R = T&>
Dune::DenseIterator< C, T, R >::DenseIterator ( )
inline

§ DenseIterator() [2/4]

template<class C , class T , class R = T&>
Dune::DenseIterator< C, T, R >::DenseIterator ( C &  cont,
SizeType  pos 
)
inline

§ DenseIterator() [3/4]

template<class C , class T , class R = T&>
Dune::DenseIterator< C, T, R >::DenseIterator ( const MutableIterator other)
inline

§ DenseIterator() [4/4]

template<class C , class T , class R = T&>
Dune::DenseIterator< C, T, R >::DenseIterator ( const ConstIterator other)
inline

Member Function Documentation

§ advance()

template<class C , class T , class R = T&>
void Dune::DenseIterator< C, T, R >::advance ( DifferenceType  n)
inline

§ decrement()

template<class C , class T , class R = T&>
void Dune::DenseIterator< C, T, R >::decrement ( )
inline

§ dereference()

template<class C , class T , class R = T&>
R Dune::DenseIterator< C, T, R >::dereference ( ) const
inline

§ distanceTo() [1/2]

template<class C , class T , class R = T&>
DifferenceType Dune::DenseIterator< C, T, R >::distanceTo ( DenseIterator< const typename std::remove_const< C >::type, const typename std::remove_const< T >::type >  other) const
inline

§ distanceTo() [2/2]

template<class C , class T , class R = T&>
DifferenceType Dune::DenseIterator< C, T, R >::distanceTo ( DenseIterator< typename std::remove_const< C >::type, typename std::remove_const< T >::type >  other) const
inline

§ elementAt()

template<class C , class T , class R = T&>
R Dune::DenseIterator< C, T, R >::elementAt ( DifferenceType  i) const
inline

§ equals() [1/2]

template<class C , class T , class R = T&>
bool Dune::DenseIterator< C, T, R >::equals ( const MutableIterator other) const
inline

§ equals() [2/2]

template<class C , class T , class R = T&>
bool Dune::DenseIterator< C, T, R >::equals ( const ConstIterator other) const
inline

§ increment()

template<class C , class T , class R = T&>
void Dune::DenseIterator< C, T, R >::increment ( )
inline

§ index()

template<class C , class T , class R = T&>
SizeType Dune::DenseIterator< C, T, R >::index ( ) const
inline

return index

§ operator*()

Reference Dune::RandomAccessIteratorFacade< DenseIterator< C, T, R > , T , R, std::ptrdiff_t >::operator* ( ) const
inlineinherited

Dereferencing operator.

§ operator+()

DerivedType Dune::RandomAccessIteratorFacade< DenseIterator< C, T, R > , T , R, std::ptrdiff_t >::operator+ ( DifferenceType  n) const
inlineinherited

§ operator++() [1/2]

DerivedType& Dune::RandomAccessIteratorFacade< DenseIterator< C, T, R > , T , R, std::ptrdiff_t >::operator++ ( )
inlineinherited

Preincrement operator.

§ operator++() [2/2]

DerivedType Dune::RandomAccessIteratorFacade< DenseIterator< C, T, R > , T , R, std::ptrdiff_t >::operator++ ( int  )
inlineinherited

Postincrement operator.

§ operator+=()

DerivedType& Dune::RandomAccessIteratorFacade< DenseIterator< C, T, R > , T , R, std::ptrdiff_t >::operator+= ( DifferenceType  n)
inlineinherited

§ operator-()

DerivedType Dune::RandomAccessIteratorFacade< DenseIterator< C, T, R > , T , R, std::ptrdiff_t >::operator- ( DifferenceType  n) const
inlineinherited

§ operator--() [1/2]

DerivedType& Dune::RandomAccessIteratorFacade< DenseIterator< C, T, R > , T , R, std::ptrdiff_t >::operator-- ( )
inlineinherited

Predecrement operator.

§ operator--() [2/2]

DerivedType Dune::RandomAccessIteratorFacade< DenseIterator< C, T, R > , T , R, std::ptrdiff_t >::operator-- ( int  )
inlineinherited

Postdecrement operator.

§ operator-=()

DerivedType& Dune::RandomAccessIteratorFacade< DenseIterator< C, T, R > , T , R, std::ptrdiff_t >::operator-= ( DifferenceType  n)
inlineinherited

§ operator->()

Pointer Dune::RandomAccessIteratorFacade< DenseIterator< C, T, R > , T , R, std::ptrdiff_t >::operator-> ( ) const
inlineinherited

§ operator[]()

Reference Dune::RandomAccessIteratorFacade< DenseIterator< C, T, R > , T , R, std::ptrdiff_t >::operator[] ( DifferenceType  n) const
inlineinherited

Get the element n positions from the current one.

Parameters
nThe distance to the element.
Returns
The element at that distance.

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