dune-common 2.11
Loading...
Searching...
No Matches
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

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

Friends

class DenseIterator< typename std::remove_const< C >::type, typename std::remove_const< T >::type, typename mutable_reference< R >::type >
 
class DenseIterator< const typename std::remove_const< C >::type, const typename std::remove_const< T >::type, typename const_reference< R >::type >
 

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
constexpr R dereference() const
Definition densevector.hh:193
constexpr R elementAt(DifferenceType i) const
Definition densevector.hh:207
constexpr bool equals(const MutableIterator &other) const
Definition densevector.hh:182
constexpr void increment()
Definition densevector.hh:197
constexpr void decrement()
Definition densevector.hh:202
constexpr DifferenceType distanceTo(DenseIterator< const typename std::remove_const< C >::type, const typename std::remove_const< T >::type > other) const
Definition densevector.hh:215
constexpr void advance(DifferenceType n)
Definition densevector.hh:211
R Reference
The type of the reference to the values accessed.
Definition iteratorfacades.hh:498

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&>
constexpr Dune::DenseIterator< C, T, R >::DenseIterator ( )
inlineconstexpr

◆ DenseIterator() [2/4]

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

◆ DenseIterator() [3/4]

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

◆ DenseIterator() [4/4]

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

Member Function Documentation

◆ advance()

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

◆ decrement()

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

◆ dereference()

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

◆ distanceTo() [1/2]

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

◆ distanceTo() [2/2]

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

◆ elementAt()

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

◆ equals() [1/2]

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

◆ equals() [2/2]

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

◆ increment()

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

◆ index()

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

return index

◆ operator*()

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

Dereferencing operator.

◆ operator+()

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

◆ operator++() [1/2]

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

Preincrement operator.

◆ operator++() [2/2]

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

Postincrement operator.

◆ operator+=()

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

◆ operator-()

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

◆ operator--() [1/2]

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

Predecrement operator.

◆ operator--() [2/2]

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

Postdecrement operator.

◆ operator-=()

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

◆ operator->()

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ operator[]()

template<class T , class V , class R = V&, class D = std::ptrdiff_t>
constexpr Reference Dune::RandomAccessIteratorFacade< T, V, R, D >::operator[] ( DifferenceType  n) const
inlineconstexprinherited

Get the element n positions from the current one.

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

Friends And Related Symbol Documentation

◆ DenseIterator< const typename std::remove_const< C >::type, const typename std::remove_const< T >::type, typename const_reference< R >::type >

template<class C , class T , class R = T&>
friend class DenseIterator< const typename std::remove_const< C >::type, const typename std::remove_const< T >::type, typename const_reference< R >::type >
friend

◆ DenseIterator< typename std::remove_const< C >::type, typename std::remove_const< T >::type, typename mutable_reference< R >::type >

template<class C , class T , class R = T&>
friend class DenseIterator< typename std::remove_const< C >::type, typename std::remove_const< T >::type, typename mutable_reference< R >::type >
friend

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