abLEMON 1.9.0-101-gccb8629
A maintained fork of LEMON
Loading...
Searching...
No Matches
Graph::IncEdgeIt Class Reference

Iterator class for the incident edges of a node. More...

#include <lemon/concepts/graph.h>

Inheritance diagram for Graph::IncEdgeIt:

Public Member Functions

 IncEdgeIt ()
 Default constructor.
 IncEdgeIt (const IncEdgeIt &e)
 Copy constructor.
const IncEdgeIt & operator= (const IncEdgeIt &)
 Assignment operator.
 IncEdgeIt (Invalid)
 Invalid constructor & conversion.
 IncEdgeIt (const Graph &, const Node &)
 Sets the iterator to the first incident edge.
 IncEdgeIt (const Graph &, const Edge &)
 Sets the iterator to the given edge.
IncEdgeIt & operator++ ()
 Next incident edge.
Public Member Functions inherited from Graph::Edge
 Edge ()
 Default constructor.
 Edge (const Edge &)
 Copy constructor.
const Edge & operator= (const Edge &)
 Assignment operator.
 Edge (Invalid)
 Invalid constructor & conversion.
bool operator== (Edge) const
 Equality operator.
bool operator!= (Edge) const
 Inequality operator.
bool operator< (Edge) const
 Artificial ordering operator.

Detailed Description

This iterator goes trough the incident undirected edges of a certain node of a graph. Its usage is quite simple, for example, you can compute the degree (i.e. the number of incident edges) of a node n in a graph g of type Graph as follows.

int count = 0;
for( Graph::IncEdgeIt e( g , n ) ; e != INVALID ; ++e )
++count;
Iterator class for the incident edges of a node.
Definition graph.h:359
const Invalid INVALID
Invalid iterators.
Definition base.cc:33
Warning
Loop edges will be iterated twice.

Constructor & Destructor Documentation

◆ IncEdgeIt() [1/5]

IncEdgeIt ( )
inline

Default constructor.

Warning
It sets the iterator to an undefined value.

◆ IncEdgeIt() [2/5]

IncEdgeIt ( const IncEdgeIt & e)
inline

Copy constructor.

◆ IncEdgeIt() [3/5]

IncEdgeIt ( Invalid )
inline

Initializes the iterator to be invalid.

See also
Invalid for more details.

◆ IncEdgeIt() [4/5]

IncEdgeIt ( const Graph & ,
const Node &  )
inline

Sets the iterator to the first incident edge of the given node.

◆ IncEdgeIt() [5/5]

IncEdgeIt ( const Graph & ,
const Edge &  )
inline

Sets the iterator to the given edge of the given graph.

Member Function Documentation

◆ operator=()

const IncEdgeIt & operator= ( const IncEdgeIt & )
inline

Assignment operator.

◆ operator++()

IncEdgeIt & operator++ ( )
inline

Assign the iterator to the next incident edge of the corresponding node.