Loading...
Searching...
No Matches
Dune::DenseIterator< C, T, R > Class Template Reference
Common » 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, R >:

## 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 DenseIterator & | operator= (const ConstIterator &other)
constexpr DenseIterator & | operator= (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 DerivedType & | operator++ ()
| Preincrement operator.
constexpr DerivedType | operator++ (int)
| Postincrement operator.
constexpr DerivedType & | operator+= (DifferenceType n)
constexpr DerivedType | operator+ (DifferenceType n) const
constexpr DerivedType & | operator-- ()
| Predecrement operator.
constexpr DerivedType | operator-- (int)
| Postdecrement operator.
constexpr DerivedType & | operator-= (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.
Reference dereference() const;
// Access the value at some other location
Reference elementAt(n) const;
// 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-
void advance(DifferenceType n);
// calculate the distance to another iterator.
// One should incorporate an assertion whether
// the same containers are referenced
DifferenceType distanceTo(j) const;
Dune::DenseIterator::dereference
constexpr R dereference() const
Definition densevector.hh:193
Dune::DenseIterator::elementAt
constexpr R elementAt(DifferenceType i) const
Definition densevector.hh:207
Dune::DenseIterator::equals
constexpr bool equals(const MutableIterator &other) const
Definition densevector.hh:182
Dune::DenseIterator::increment
constexpr void increment()
Definition densevector.hh:197
Dune::DenseIterator::decrement
constexpr void decrement()
Definition densevector.hh:202
Dune::DenseIterator::DifferenceType
std::ptrdiff_t DifferenceType
The type of the difference between two positions.
Definition densevector.hh:143
Dune::DenseIterator::distanceTo
constexpr DifferenceType distanceTo(DenseIterator< const typename std::remove_const< C >::type, const typename std::remove_const< T >::type > other) const
Definition densevector.hh:215
Dune::DenseIterator::advance
constexpr void advance(DifferenceType n)
Definition densevector.hh:211
Dune::RandomAccessIteratorFacade::Reference
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>

typedef V* Dune::RandomAccessIteratorFacade< T, V, R, D >::Pointer

inherited

The pointer to the Value.

## pointer

template<class T, class V, class R = V&, class D = std::ptrdiff_t>

using Dune::RandomAccessIteratorFacade< T, V, R, D >::pointer = V*

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.

## reference

template<class T, class V, class R = V&, class D = std::ptrdiff_t>

using Dune::RandomAccessIteratorFacade< T, V, R, D >::reference = R

inherited

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

## DenseIterator() [2/4]

template<class C, class T, class R = T&>

Dune::DenseIterator< C, T, R >::DenseIterator | ( | C & | cont,
|  | SizeType | pos )

inline constexpr

## DenseIterator() [3/4]

template<class C, class T, class R = T&>

Dune::DenseIterator< C, T, R >::DenseIterator | ( | const MutableIterator & | other | ) |

inline constexpr

## DenseIterator() [4/4]

template<class C, class T, class R = T&>

Dune::DenseIterator< C, T, R >::DenseIterator | ( | const ConstIterator & | other | ) |

inline constexpr

## Member Function Documentation

## advance()

template<class C, class T, class R = T&>

void Dune::DenseIterator< C, T, R >::advance | ( | DifferenceType | n | ) |

inline constexpr

## decrement()

template<class C, class T, class R = T&>

void Dune::DenseIterator< C, T, R >::decrement | ( |  | ) |

inline constexpr

## dereference()

template<class C, class T, class R = T&>

R Dune::DenseIterator< C, T, R >::dereference | ( |  | ) | const

inline constexpr

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

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

## elementAt()

template<class C, class T, class R = T&>

R Dune::DenseIterator< C, T, R >::elementAt | ( | DifferenceType | i | ) | const

inline constexpr

## equals() [1/2]

template<class C, class T, class R = T&>

bool Dune::DenseIterator< C, T, R >::equals | ( | const ConstIterator & | other | ) | const

inline constexpr

## equals() [2/2]

template<class C, class T, class R = T&>

bool Dune::DenseIterator< C, T, R >::equals | ( | const MutableIterator & | other | ) | const

inline constexpr

## increment()

template<class C, class T, class R = T&>

void Dune::DenseIterator< C, T, R >::increment | ( |  | ) |

inline constexpr

## index()

template<class C, class T, class R = T&>

SizeType Dune::DenseIterator< C, T, R >::index | ( |  | ) | const

inline constexpr

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

inline constexpr inherited

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

inline constexpr inherited

## operator++() [1/2]

template<class T, class V, class R = V&, class D = std::ptrdiff_t>

DerivedType & Dune::RandomAccessIteratorFacade< T, V, R, D >::operator++ | ( |  | ) |

inline constexpr inherited

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

inline constexpr inherited

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

inline constexpr inherited

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

inline constexpr inherited

## operator--() [1/2]

template<class T, class V, class R = V&, class D = std::ptrdiff_t>

DerivedType & Dune::RandomAccessIteratorFacade< T, V, R, D >::operator-- | ( |  | ) |

inline constexpr inherited

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

inline constexpr inherited

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

inline constexpr inherited

## operator->()

template<class T, class V, class R = V&, class D = std::ptrdiff_t>

Pointer Dune::RandomAccessIteratorFacade< T, V, R, D >::operator-> | ( |  | ) | const

inline constexpr inherited

## operator=() [1/2]

template<class C, class T, class R = T&>

DenseIterator & Dune::DenseIterator< C, T, R >::operator= | ( | const ConstIterator & | other | ) |

inline constexpr

## operator=() [2/2]

template<class C, class T, class R = T&>

DenseIterator & Dune::DenseIterator< C, T, R >::operator= | ( | const MutableIterator & | other | ) |

inline constexpr

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

inline constexpr 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 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:

- densevector.hh