31.01.2014 Views

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

13.3 Edge Iterators ( EdgeIt )<br />

1. Definition<br />

a variable it of class EdgeIt is a linear edge iterator that iterates over the edge set of a<br />

graph; the current edge of an iterator object is said to be “marked” by this object.<br />

#include < <strong>LEDA</strong>/graph/graph iterator.h ><br />

2. Creation<br />

EdgeIt it;<br />

introduces a variable it of this class associated with no graph.<br />

EdgeIt it(const leda :: graph& G);<br />

introduces a variable it of this class associated with G and marked<br />

with G.first edge( ).<br />

EdgeIt it(const leda :: graph& G, leda :: edge e);<br />

introduces a variable it of this class marked with e and associated<br />

with G.<br />

Precondition: e is an edge of G.<br />

3. Operations<br />

void it.init(const leda :: graph& G)<br />

associates it with G and marks it with G.first edge( ).<br />

void it.init(const leda :: graph& G, const leda :: edge& e)<br />

void it.update(leda :: edge e)<br />

associates it with G and marks it with e.<br />

it marks e afterwards.<br />

void it.reset( ) resets it to G.first edge( ) where G is the associated<br />

graph.<br />

void it.reset end( ) resets it to G.last edge( ) where G is the associated<br />

graph.<br />

void it.make invalid( ) makes it invalid, i.e. it.valid( ) will be false afterwards<br />

and it marks no node.<br />

void it.insert(leda :: node v1 , leda :: node v2 )<br />

creates a new edge from v1 to v2 and it marks it<br />

afterwards.<br />

void it.del( ) deletes the marked edge, i.e. it.valid( ) returns false<br />

afterwards.<br />

Precondition: it.valid( ) returns true.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!