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.

ool it.eol( ) returns !it.valid( ) which is true if and only if there is<br />

no successor edge left, i.e. if all edges of the edge set<br />

are passed (eol: end of list).<br />

bool it.valid( ) returns true if and only if end of sequence not yet<br />

passed, i.e. if there is an edge in the edge set that was<br />

not yet passed.<br />

leda :: edge it.get edge( ) returns the marked edge or nil if it.valid( ) returns<br />

false.<br />

leda :: node it.get node( ) returns the marked node or nil if it.has node( ) returns<br />

false.<br />

const leda :: graph& it.get graph( )<br />

returns the associated graph.<br />

InAdjIt it.curr adj( ) returns a new adjacency iterator that is associated<br />

with n’ = source(e) and G.first in edge(n’) where G is<br />

the associated graph.<br />

Precondition: it.valid( ) returns true.<br />

InAdjIt& ++it performs one step forward in the list of incoming edges<br />

of the marked node. If there is no successor edge,<br />

it.eol( ) will be true afterwards. This method returns<br />

a reference to it.<br />

Precondition: it.valid( ) returns true.<br />

InAdjIt& −−it performs one step backward in the list of incoming<br />

edges of the marked node. If there is no predecesssor<br />

edge, it.eol( ) will be true afterwards. This method<br />

returns a reference to it.<br />

Precondition: it.valid( ) returns true.<br />

4. Implementation<br />

Creation of an iterator and all methods take constant time.<br />

13.7 Adjacency Iterators ( AdjIt )<br />

1. Definition<br />

a variable it of class AdjIt is an adjacency iterator that marks a node (which is fixed in<br />

contrast to linear node iterators) and iterates over the edges that leave or enter this node.<br />

At first, all outgoing edges will be traversed.<br />

Internally, this iterator creates two instances of OutAdjIt and InAdjIt. <strong>The</strong> iteration is<br />

a sequenced iteration over both iterators. Note that this only fits for directed graph, for<br />

undirected graph you should use OutAdjIt instead.

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

Saved successfully!

Ooh no, something went wrong!