HyperHDG
Public Member Functions | Private Attributes | List of all members
HDGHyperGraph< n_dofs_per_nodeT, TopoT, GeomT, NodeT, DataT, hyEdge_index_t >::iterator Class Reference

Iterator for struct hyEdge returned by operator[]. More...

Collaboration diagram for HDGHyperGraph< n_dofs_per_nodeT, TopoT, GeomT, NodeT, DataT, hyEdge_index_t >::iterator:
Collaboration graph
[legend]

Public Member Functions

 iterator (HDGHyperGraph &hyGraph, const hyEdge_index_t index)
 Construct an iterator from an HDGHyperGraph and an index. More...
 
 iterator (const iterator &other)
 Copy–construct an iterator from another iterator. More...
 
iteratoroperator= (const iterator &other)=default
 Copy–assign an iterator from another iterator. More...
 
iteratoroperator++ ()
 Increment iterator and return incremented iterator. More...
 
iteratoroperator-- ()
 Decrement iterator and return incremented iterator. More...
 
iterator operator++ (int)
 Increment iterator and return old iterator. More...
 
iterator operator-- (int)
 Decrement iterator and return old iterator. More...
 
HDGHyperGraph::value_type operator* ()
 Dereference iterator to hyEdge. More...
 
bool operator== (const iterator &other)
 Check for equality with another iterator. More...
 

Private Attributes

HDGHyperGraphhyGraph_
 Reference to the HDGHyperGraph of the iterator. More...
 
hyEdge_index_t index_
 Index of the hyEdge of the iterator. More...
 

Detailed Description

template<unsigned int n_dofs_per_nodeT, class TopoT, class GeomT, class NodeT, class DataT = EmptyC, typename hyEdge_index_t = unsigned int>
class HDGHyperGraph< n_dofs_per_nodeT, TopoT, GeomT, NodeT, DataT, hyEdge_index_t >::iterator

Iterator for struct hyEdge returned by operator[].


Iterator that allows to go through the hyperedges of a hypergraph forwards and backwards. This iterator fulfills the preconditions to allow the use of std::for_each on the set of hyperedges that are contained in the HDGHyperGraph.

Constructor & Destructor Documentation

◆ iterator() [1/2]

template<unsigned int n_dofs_per_nodeT, class TopoT , class GeomT , class NodeT , class DataT = EmptyC, typename hyEdge_index_t = unsigned int>
HDGHyperGraph< n_dofs_per_nodeT, TopoT, GeomT, NodeT, DataT, hyEdge_index_t >::iterator::iterator ( HDGHyperGraph hyGraph,
const hyEdge_index_t  index 
)
inline

Construct an iterator from an HDGHyperGraph and an index.


Construct HDGHyperGraph::iterator by passing over an HDGHyperGraph object and the index the iterator is supposed to dot at.

Parameters
hyGraphThe HDGHyperGraph, the iterator refers to.
indexIndex of the object, the iterator dots at.

◆ iterator() [2/2]

template<unsigned int n_dofs_per_nodeT, class TopoT , class GeomT , class NodeT , class DataT = EmptyC, typename hyEdge_index_t = unsigned int>
HDGHyperGraph< n_dofs_per_nodeT, TopoT, GeomT, NodeT, DataT, hyEdge_index_t >::iterator::iterator ( const iterator other)
inline

Copy–construct an iterator from another iterator.


Construct HDGHyperGraph::iterator as copy of another one.

Parameters
otherOther iterator which is copied.

Member Function Documentation

◆ operator*()

template<unsigned int n_dofs_per_nodeT, class TopoT , class GeomT , class NodeT , class DataT = EmptyC, typename hyEdge_index_t = unsigned int>
HDGHyperGraph::value_type HDGHyperGraph< n_dofs_per_nodeT, TopoT, GeomT, NodeT, DataT, hyEdge_index_t >::iterator::operator* ( )
inline

Dereference iterator to hyEdge.


This function dereferences the iterator and returns the hyEdge this iterator dots at.

Return values
hyEdgeThe hyperedge described by the iterator.

◆ operator++() [1/2]

template<unsigned int n_dofs_per_nodeT, class TopoT , class GeomT , class NodeT , class DataT = EmptyC, typename hyEdge_index_t = unsigned int>
iterator& HDGHyperGraph< n_dofs_per_nodeT, TopoT, GeomT, NodeT, DataT, hyEdge_index_t >::iterator::operator++ ( )
inline

Increment iterator and return incremented iterator.


This function incements the iterator and returns the incremented iterator. Thus, no new iterator needs to be constructed and only a reference needs to be returned. This makes the function more performant compared to iterator operator++(int). It is executed using ++iterator and not iterator++.

Return values
incementedThe incremented iterator.

◆ operator++() [2/2]

template<unsigned int n_dofs_per_nodeT, class TopoT , class GeomT , class NodeT , class DataT = EmptyC, typename hyEdge_index_t = unsigned int>
iterator HDGHyperGraph< n_dofs_per_nodeT, TopoT, GeomT, NodeT, DataT, hyEdge_index_t >::iterator::operator++ ( int  )
inline

Increment iterator and return old iterator.


This function incements the iterator and returns the old iterator. Thus, a new iterator needs to be constructed and only a reference needs to be returned. This makes the function less performant compared to iterator operator++(). It is executed using iterator++ and not ++iterator.

Return values
incementedThe incremented iterator.
Here is the call graph for this function:

◆ operator--() [1/2]

template<unsigned int n_dofs_per_nodeT, class TopoT , class GeomT , class NodeT , class DataT = EmptyC, typename hyEdge_index_t = unsigned int>
iterator& HDGHyperGraph< n_dofs_per_nodeT, TopoT, GeomT, NodeT, DataT, hyEdge_index_t >::iterator::operator-- ( )
inline

Decrement iterator and return incremented iterator.


This function decements the iterator and returns the decremented iterator. Thus, no new iterator needs to be constructed and only a reference needs to be returned. This makes the function more performant compared to iterator operator--(int). It is executed using –iterator and not iterator–.

Return values
decementedThe decremented iterator.

◆ operator--() [2/2]

template<unsigned int n_dofs_per_nodeT, class TopoT , class GeomT , class NodeT , class DataT = EmptyC, typename hyEdge_index_t = unsigned int>
iterator HDGHyperGraph< n_dofs_per_nodeT, TopoT, GeomT, NodeT, DataT, hyEdge_index_t >::iterator::operator-- ( int  )
inline

Decrement iterator and return old iterator.


This function decements the iterator and returns the old iterator. Thus, a new iterator needs to be constructed and only a reference needs to be returned. This makes the function less performant compared to iterator operator--(). It is executed using iterator– and not –iterator.

Return values
decementedThe decremented iterator.
Here is the call graph for this function:

◆ operator=()

template<unsigned int n_dofs_per_nodeT, class TopoT , class GeomT , class NodeT , class DataT = EmptyC, typename hyEdge_index_t = unsigned int>
iterator& HDGHyperGraph< n_dofs_per_nodeT, TopoT, GeomT, NodeT, DataT, hyEdge_index_t >::iterator::operator= ( const iterator other)
default

Copy–assign an iterator from another iterator.


Asign a given HDGHyperGraph::iterator to be a copy of another one

Parameters
otherOther iterator which is copied.

◆ operator==()

template<unsigned int n_dofs_per_nodeT, class TopoT , class GeomT , class NodeT , class DataT = EmptyC, typename hyEdge_index_t = unsigned int>
bool HDGHyperGraph< n_dofs_per_nodeT, TopoT, GeomT, NodeT, DataT, hyEdge_index_t >::iterator::operator== ( const iterator other)
inline

Check for equality with another iterator.


This function checks whether the current iterator is equal to anoother iterator. In this context equal means that they refer to the same HDGHyperGraph and have the same index.

Parameters
otheriterator which is checked to be equal.
Return values
is_equalboolean which is true if both iterators are equal and false otherwise.

Member Data Documentation

◆ hyGraph_

template<unsigned int n_dofs_per_nodeT, class TopoT , class GeomT , class NodeT , class DataT = EmptyC, typename hyEdge_index_t = unsigned int>
HDGHyperGraph& HDGHyperGraph< n_dofs_per_nodeT, TopoT, GeomT, NodeT, DataT, hyEdge_index_t >::iterator::hyGraph_
private

Reference to the HDGHyperGraph of the iterator.


The hyEdge is characterized via its respective HDGHypergraph (of which the reference is saved) and its index who need to be members of the iterator.

◆ index_

template<unsigned int n_dofs_per_nodeT, class TopoT , class GeomT , class NodeT , class DataT = EmptyC, typename hyEdge_index_t = unsigned int>
hyEdge_index_t HDGHyperGraph< n_dofs_per_nodeT, TopoT, GeomT, NodeT, DataT, hyEdge_index_t >::iterator::index_
private

Index of the hyEdge of the iterator.


The hyEdge is characterized via its respective HDGHypergraph (of which the reference is saved) and its index who need to be members of the iterator.


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