Dune::DenseIterator< C, T > Class Template Reference
[Dense Matrix and Vector Template Library]

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

#include <dune/common/densevector.hh>

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

List of all members.

Public Types

typedef std::ptrdiff_t DifferenceType
 The type of the difference between two positions.
typedef C::size_type SizeType
 The type to index the underlying container.
typedef DenseIterator< C, T > 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 T & Reference
 The type of the reference to the values accessed.

Public Member Functions

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

Friends

class DenseIterator< typename remove_const< C >::type, typename remove_const< T >::type >
class DenseIterator< const typename remove_const< C >::type, const typename remove_const< T >::type >

Detailed Description

template<class C, class T>
class Dune::DenseIterator< C, T >

Generic iterator class for dense vector and matrix implementations.

provides sequential access to DenseVector, FieldVector and FieldMatrix


Member Typedef Documentation

typedef DenseIterator< C, T > Dune::RandomAccessIteratorFacade< DenseIterator< C, T > , T , T & , 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.
 Reference dereference() const;
 // Access the value at some other location
 Reference elementAt(n) const;

 // Compare for equality with j
 equals(i);

 // 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-
 void advance(DifferenceType n);
 // calculate the distance to another iterator.
 // One should incorporate an assertion wether
 // the same containers are referenced
 DifferenceType distanceTo(j) const;

For an elaborate explanation see the STL Documentation

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

The type of the difference between two positions.

Reimplemented from Dune::RandomAccessIteratorFacade< DenseIterator< C, T >, T, T &, std::ptrdiff_t >.

typedef T * Dune::RandomAccessIteratorFacade< DenseIterator< C, T > , T , T & , std::ptrdiff_t >::Pointer [inherited]

The pointer to the Value.

typedef T & Dune::RandomAccessIteratorFacade< DenseIterator< C, T > , T , T & , std::ptrdiff_t >::Reference [inherited]

The type of the reference to the values accessed.

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

The type to index the underlying container.

typedef T Dune::RandomAccessIteratorFacade< DenseIterator< C, T > , T , T & , std::ptrdiff_t >::Value [inherited]

The type of value accessed through the iterator.


Constructor & Destructor Documentation

template<class C , class T >
Dune::DenseIterator< C, T >::DenseIterator (  )  [inline]
template<class C , class T >
Dune::DenseIterator< C, T >::DenseIterator ( C &  cont,
SizeType  pos 
) [inline]
template<class C , class T >
Dune::DenseIterator< C, T >::DenseIterator ( const DenseIterator< typename remove_const< C >::type, typename remove_const< T >::type > &  other  )  [inline]

Member Function Documentation

template<class C , class T >
void Dune::DenseIterator< C, T >::decrement (  )  [inline]
template<class C , class T >
T& Dune::DenseIterator< C, T >::dereference (  )  const [inline]
template<class C , class T >
DifferenceType Dune::DenseIterator< C, T >::distanceTo ( DenseIterator< const typename remove_const< C >::type, const typename remove_const< T >::type >  other  )  const [inline]
template<class C , class T >
DifferenceType Dune::DenseIterator< C, T >::distanceTo ( DenseIterator< typename remove_const< C >::type, typename remove_const< T >::type >  other  )  const [inline]
template<class C , class T >
T& Dune::DenseIterator< C, T >::elementAt ( DifferenceType  i  )  const [inline]
template<class C , class T >
bool Dune::DenseIterator< C, T >::equals ( const DenseIterator< const typename remove_const< C >::type, const typename remove_const< T >::type > &  other  )  const [inline]
template<class C , class T >
bool Dune::DenseIterator< C, T >::equals ( const DenseIterator< typename remove_const< C >::type, typename remove_const< T >::type > &  other  )  const [inline]
template<class C , class T >
void Dune::DenseIterator< C, T >::increment (  )  [inline]
template<class C , class T >
SizeType Dune::DenseIterator< C, T >::index (  )  const [inline]

return index

Reference Dune::RandomAccessIteratorFacade< DenseIterator< C, T > , T , T & , std::ptrdiff_t >::operator* (  )  const [inline, inherited]

Dereferencing operator.

DerivedType Dune::RandomAccessIteratorFacade< DenseIterator< C, T > , T , T & , std::ptrdiff_t >::operator+ ( DifferenceType  n  )  const [inline, inherited]
DerivedType Dune::RandomAccessIteratorFacade< DenseIterator< C, T > , T , T & , std::ptrdiff_t >::operator++ ( int   )  [inline, inherited]
DerivedType& Dune::RandomAccessIteratorFacade< DenseIterator< C, T > , T , T & , std::ptrdiff_t >::operator++ (  )  [inline, inherited]

Preincrement operator.

DerivedType& Dune::RandomAccessIteratorFacade< DenseIterator< C, T > , T , T & , std::ptrdiff_t >::operator+= ( DifferenceType  n  )  [inline, inherited]
DerivedType Dune::RandomAccessIteratorFacade< DenseIterator< C, T > , T , T & , std::ptrdiff_t >::operator- ( DifferenceType  n  )  const [inline, inherited]
DerivedType& Dune::RandomAccessIteratorFacade< DenseIterator< C, T > , T , T & , std::ptrdiff_t >::operator-- (  )  [inline, inherited]

Predecrement operator.

DerivedType Dune::RandomAccessIteratorFacade< DenseIterator< C, T > , T , T & , std::ptrdiff_t >::operator-- ( int   )  [inline, inherited]
DerivedType& Dune::RandomAccessIteratorFacade< DenseIterator< C, T > , T , T & , std::ptrdiff_t >::operator-= ( DifferenceType  n  )  [inline, inherited]
Pointer Dune::RandomAccessIteratorFacade< DenseIterator< C, T > , T , T & , std::ptrdiff_t >::operator-> (  )  const [inline, inherited]
Reference Dune::RandomAccessIteratorFacade< DenseIterator< C, T > , T , T & , std::ptrdiff_t >::operator[] ( DifferenceType  n  )  const [inline, inherited]

Get the element n positions from the current one.

Parameters:
n The distance to the element.
Returns:
The element at that distance.

Friends And Related Function Documentation

template<class C , class T >
friend class DenseIterator< const typename remove_const< C >::type, const typename remove_const< T >::type > [friend]
template<class C , class T >
friend class DenseIterator< typename remove_const< C >::type, typename remove_const< T >::type > [friend]

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

Generated on Fri Apr 29 2011 with Doxygen (ver 1.7.1) [doxygen-log,error-log].