dune-common  2.11
Public Types | Public Member Functions | Friends | 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...
 
using iterator_category = std::random_access_iterator_tag
 
using value_type = typename std::remove_const< T >::type
 
using difference_type = std::ptrdiff_t
 
using pointer = T *
 
using reference = R
 
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

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 More...
 
constexpr Reference operator* () const
 Dereferencing operator. More...
 
constexpr Pointer operator-> () const
 
constexpr Reference operator[] (DifferenceType n) const
 Get the element n positions from the current one. More...
 
constexpr DerivedTypeoperator++ ()
 Preincrement operator. More...
 
constexpr DerivedType operator++ (int)
 Postincrement operator. More...
 
constexpr DerivedTypeoperator+= (DifferenceType n)
 
constexpr DerivedType operator+ (DifferenceType n) const
 
constexpr DerivedTypeoperator-- ()
 Predecrement operator. More...
 
constexpr DerivedType operator-- (int)
 Postdecrement operator. More...
 
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

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

◆ difference_type

using Dune::RandomAccessIteratorFacade< DenseIterator< C, T, R > , T , R, std::ptrdiff_t >::difference_type = std::ptrdiff_t
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

using Dune::RandomAccessIteratorFacade< DenseIterator< C, T, R > , T , R, std::ptrdiff_t >::iterator_category = std::random_access_iterator_tag
inherited

◆ pointer

using Dune::RandomAccessIteratorFacade< DenseIterator< C, T, R > , T , R, std::ptrdiff_t >::pointer = T *
inherited

◆ Pointer

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

The pointer to the Value.

◆ reference

using Dune::RandomAccessIteratorFacade< DenseIterator< C, T, R > , T , R, std::ptrdiff_t >::reference = R
inherited

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

◆ value_type

using Dune::RandomAccessIteratorFacade< DenseIterator< C, T, R > , T , R, std::ptrdiff_t >::value_type = typename std::remove_const<T >::type
inherited

Constructor & Destructor Documentation

◆ DenseIterator() [1/4]

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

◆ DenseIterator() [2/4]

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

◆ DenseIterator() [3/4]

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

◆ DenseIterator() [4/4]

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

Member Function Documentation

◆ advance()

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

◆ decrement()

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

◆ dereference()

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

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

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

◆ elementAt()

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

◆ equals() [1/2]

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

◆ equals() [2/2]

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

◆ increment()

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

◆ index()

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

return index

◆ operator*()

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

Dereferencing operator.

◆ operator+()

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

◆ operator++() [1/2]

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

Preincrement operator.

◆ operator++() [2/2]

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

Postincrement operator.

◆ operator+=()

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

◆ operator-()

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

◆ operator--() [1/2]

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

Predecrement operator.

◆ operator--() [2/2]

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

Postdecrement operator.

◆ operator-=()

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

◆ operator->()

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ operator[]()

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

Friends And Related Function 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: