dune-common 2.9.0
Loading...
Searching...
No Matches
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.
 
typedef C::size_type SizeType
 The type to index the underlying container.
 
using iterator_category = std::random_access_iterator_tag
 
using value_type = typename std::remove_const< V >::type
 
using difference_type = D
 
using pointer = V *
 
using reference = R
 
typedef T DerivedType
 The type of derived iterator.
 
typedef V Value
 The type of value accessed through the iterator.
 
typedef V * Pointer
 The pointer to the Value.
 
typedef R Reference
 The type of the reference to the values accessed.
 

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

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

template<class T , class V , class R = V&, class D = std::ptrdiff_t>
typedef T Dune::RandomAccessIteratorFacade< T, V, R, D >::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
void increment()
Definition densevector.hh:182
bool equals(const MutableIterator &other) const
Definition densevector.hh:167
R elementAt(DifferenceType i) const
Definition densevector.hh:192
DifferenceType distanceTo(DenseIterator< const typename std::remove_const< C >::type, const typename std::remove_const< T >::type > other) const
Definition densevector.hh:200
void decrement()
Definition densevector.hh:187
std::ptrdiff_t DifferenceType
The type of the difference between two positions.
Definition densevector.hh:142
R dereference() const
Definition densevector.hh:178
void advance(DifferenceType n)
Definition densevector.hh:196
R Reference
The type of the reference to the values accessed.
Definition iteratorfacades.hh:497

For an elaborate explanation see the STL Documentation

◆ difference_type

template<class T , class V , class R = V&, class D = std::ptrdiff_t>
using Dune::RandomAccessIteratorFacade< T, V, R, D >::difference_type = D
inherited

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

◆ iterator_category

template<class T , class V , class R = V&, class D = std::ptrdiff_t>
using Dune::RandomAccessIteratorFacade< T, V, R, D >::iterator_category = std::random_access_iterator_tag
inherited

◆ pointer

template<class T , class V , class R = V&, class D = std::ptrdiff_t>
using Dune::RandomAccessIteratorFacade< T, V, R, D >::pointer = V*
inherited

◆ Pointer

template<class T , class V , class R = V&, class D = std::ptrdiff_t>
typedef V* Dune::RandomAccessIteratorFacade< T, V, R, D >::Pointer
inherited

The pointer to the Value.

◆ reference

template<class T , class V , class R = V&, class D = std::ptrdiff_t>
using Dune::RandomAccessIteratorFacade< T, V, R, D >::reference = R
inherited

◆ Reference

template<class T , class V , class R = V&, class D = std::ptrdiff_t>
typedef R Dune::RandomAccessIteratorFacade< T, V, R, D >::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

template<class T , class V , class R = V&, class D = std::ptrdiff_t>
typedef V Dune::RandomAccessIteratorFacade< T, V, R, D >::Value
inherited

The type of value accessed through the iterator.

◆ value_type

template<class T , class V , class R = V&, class D = std::ptrdiff_t>
using Dune::RandomAccessIteratorFacade< T, V, R, D >::value_type = typename std::remove_const<V>::type
inherited

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 ConstIterator other) const
inline

◆ equals() [2/2]

template<class C , class T , class R = T&>
bool Dune::DenseIterator< C, T, R >::equals ( const MutableIterator 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*()

template<class T , class V , class R = V&, class D = std::ptrdiff_t>
Reference Dune::RandomAccessIteratorFacade< T, V, R, D >::operator* ( ) const
inlineinherited

Dereferencing operator.

◆ operator+()

template<class T , class V , class R = V&, class D = std::ptrdiff_t>
DerivedType Dune::RandomAccessIteratorFacade< T, V, R, D >::operator+ ( DifferenceType  n) const
inlineinherited

◆ operator++() [1/2]

template<class T , class V , class R = V&, class D = std::ptrdiff_t>
DerivedType & Dune::RandomAccessIteratorFacade< T, V, R, D >::operator++ ( )
inlineinherited

Preincrement operator.

◆ operator++() [2/2]

template<class T , class V , class R = V&, class D = std::ptrdiff_t>
DerivedType Dune::RandomAccessIteratorFacade< T, V, R, D >::operator++ ( int  )
inlineinherited

Postincrement operator.

◆ operator+=()

template<class T , class V , class R = V&, class D = std::ptrdiff_t>
DerivedType & Dune::RandomAccessIteratorFacade< T, V, R, D >::operator+= ( DifferenceType  n)
inlineinherited

◆ operator-()

template<class T , class V , class R = V&, class D = std::ptrdiff_t>
DerivedType Dune::RandomAccessIteratorFacade< T, V, R, D >::operator- ( DifferenceType  n) const
inlineinherited

◆ operator--() [1/2]

template<class T , class V , class R = V&, class D = std::ptrdiff_t>
DerivedType & Dune::RandomAccessIteratorFacade< T, V, R, D >::operator-- ( )
inlineinherited

Predecrement operator.

◆ operator--() [2/2]

template<class T , class V , class R = V&, class D = std::ptrdiff_t>
DerivedType Dune::RandomAccessIteratorFacade< T, V, R, D >::operator-- ( int  )
inlineinherited

Postdecrement operator.

◆ operator-=()

template<class T , class V , class R = V&, class D = std::ptrdiff_t>
DerivedType & Dune::RandomAccessIteratorFacade< T, V, R, D >::operator-= ( DifferenceType  n)
inlineinherited

◆ operator->()

template<class T , class V , class R = V&, class D = std::ptrdiff_t>
Pointer Dune::RandomAccessIteratorFacade< T, V, R, D >::operator-> ( ) const
inlineinherited

◆ operator[]()

template<class T , class V , class R = V&, class D = std::ptrdiff_t>
Reference Dune::RandomAccessIteratorFacade< T, V, R, D >::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: