Regina Calculation Engine
Public Types | Public Member Functions | List of all members
regina::graph::DualEdgeIterator< dim > Class Template Reference

Used to iterate through all dual edges of a dim-dimensional triangulation. More...

#include <triangulation/graph.h>

Public Types

typedef FaceList< dim, dim-1 >::Iterator InternalIterator
 The type used to iterate through (dim-1)-faces of the underlying triangulation. More...
 

Public Member Functions

 DualEdgeIterator ()=default
 Creates a singular iterator. More...
 
 DualEdgeIterator (const DualEdgeIterator &)=default
 Default copy constructor. More...
 
 DualEdgeIterator (const InternalIterator &it, const InternalIterator &end)
 Creates a new dual edge iterator corresponding to the given position in the list of (dim-1)-faces of the triangulation. More...
 
DualEdgeIteratoroperator++ ()
 Preincrement operator. More...
 
DualEdgeIterator operator++ (int)
 Postincrement operator. More...
 
DualEdge< dim > operator* () const
 Returns the dual edge to which this iterator points. More...
 
DualEdgeIteratoroperator= (const DualEdgeIterator &)=default
 Default assignment operator. More...
 
bool operator== (const DualEdgeIterator &rhs) const
 Tests whether this and the given iterator are equal. More...
 
bool operator!= (const DualEdgeIterator &rhs) const
 Tests whether this and the given iterator are different. More...
 

Detailed Description

template<int dim>
class regina::graph::DualEdgeIterator< dim >

Used to iterate through all dual edges of a dim-dimensional triangulation.

Each dual edge is dual to some (dim-1)-face of the underlying triangulation, and the order of iteration will follow the indexing of (dim-1)-faces within the triangulation. Note however that the range of dual edge iterators may be smaller, since a dual edge iterator will skip over those (dim-1)-faces that lie on the boundary of the triangulation.

When a DualEdgeIterator is dereferenced, the resulting dual edge must be given an orientation (as required by the DualEdge class). If the corresponding (dim-1)-face of the triangulation is f, then the orientation of the resulting dual edge will be from f.embedding(0).simplex() to f.embedding(1).simplex(). Note that the same dual edge could be given a different orientation if it is obtained by some other means (e.g., by dereferencing an IncidentDualEdgeIterator).

This class implements the Boost multipass input iterator concept, which is similar to the standard C++ forward iterator except that the reference type may be the same as value_type (and so, in particular, the dereference operator may return by value). This header also specialises std::iterator_traits for this iterator type.

Template Parameters
dimthe dimension of the underlying triangulation.

Member Typedef Documentation

◆ InternalIterator

template<int dim>
typedef FaceList<dim, dim-1>::Iterator regina::graph::DualEdgeIterator< dim >::InternalIterator

The type used to iterate through (dim-1)-faces of the underlying triangulation.

Constructor & Destructor Documentation

◆ DualEdgeIterator() [1/3]

template<int dim>
regina::graph::DualEdgeIterator< dim >::DualEdgeIterator ( )
default

Creates a singular iterator.

◆ DualEdgeIterator() [2/3]

template<int dim>
regina::graph::DualEdgeIterator< dim >::DualEdgeIterator ( const DualEdgeIterator< dim > &  )
default

Default copy constructor.

◆ DualEdgeIterator() [3/3]

template<int dim>
regina::graph::DualEdgeIterator< dim >::DualEdgeIterator ( const InternalIterator it,
const InternalIterator end 
)
inline

Creates a new dual edge iterator corresponding to the given position in the list of (dim-1)-faces of the triangulation.

If it points to a boundary (dim-1)-face, then the dual edge iterator will automatically skip through the list of (dim-1)-faces until it either locates an internal face or moves past-the-end. For this reason, it is not necessarily true that the dual edge *this will be dual to the (dim-1)-face *it.

Parameters
itthe corresponding iterator over the list of all (dim-1)-faces of the underlying triangulation.
endthe end of the iterator range for all (dim-1)-faces of the underlying triangulation. If the underlying triangulation is t, then this should be t.faces<dim-1>().end().

Member Function Documentation

◆ operator!=()

template<int dim>
bool regina::graph::DualEdgeIterator< dim >::operator!= ( const DualEdgeIterator< dim > &  rhs) const
inline

Tests whether this and the given iterator are different.

Parameters
rhsthe iterator to compare with this.
Returns
true if and only if the two iterators are different.

◆ operator*()

template<int dim>
DualEdge< dim > regina::graph::DualEdgeIterator< dim >::operator*
inline

Returns the dual edge to which this iterator points.

If the corresponding (dim-1)-face of the triangulation is f, then the resulting dual edge will be oriented from f.embedding(0).simplex() to f.embedding(1).simplex().

Precondition
This iterator is not past-the-end.
Returns
the dual edge to which this iterator points.

◆ operator++() [1/2]

template<int dim>
DualEdgeIterator< dim > & regina::graph::DualEdgeIterator< dim >::operator++
inline

Preincrement operator.

Returns
a reference to this iterator.

◆ operator++() [2/2]

template<int dim>
DualEdgeIterator< dim > regina::graph::DualEdgeIterator< dim >::operator++ ( int  )
inline

Postincrement operator.

Returns
a copy of this iterator before it was incremented.

◆ operator=()

template<int dim>
DualEdgeIterator& regina::graph::DualEdgeIterator< dim >::operator= ( const DualEdgeIterator< dim > &  )
default

Default assignment operator.

Returns
a reference to this iterator.

◆ operator==()

template<int dim>
bool regina::graph::DualEdgeIterator< dim >::operator== ( const DualEdgeIterator< dim > &  rhs) const
inline

Tests whether this and the given iterator are equal.

Parameters
rhsthe iterator to compare with this.
Returns
true if and only if the two iterators are equal.

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

Copyright © 1999-2021, The Regina development team
This software is released under the GNU General Public License, with some additional permissions; see the source code for details.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@maths.uq.edu.au).