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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

typename DataAccessor :: value type& ∗it<br />

returns a reference to the associated value, which originally<br />

comes from data accessor da. If the associated<br />

iterator it is not valid, a dummy value reference is<br />

returned and should not be used.<br />

Precondition: access(DA, it) returns a non constant<br />

reference to the data associated to it in DA. This<br />

functions is defined for all implemented data accessors<br />

(e.g. node array da, edge array da).<br />

13.13 Node Array Data Accessor ( node array da )<br />

1. Definition<br />

An instance da of class node array da is instantiated with a <strong>LEDA</strong> node array.<br />

<strong>The</strong> data in the node array can be accessed by the functions get(da, it) and<br />

set(da, it, value) that take as parameters an instance of node array da and an iterator,<br />

see below.<br />

node array da::value type is a type and equals T.<br />

For node map there is the variant node map da which is defined completely analogous<br />

to node array da. Classes edge array da and edge map da are defined<br />

analogously, as well.<br />

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

2. Creation<br />

node array da da;<br />

introduces a variable da of this class that is not bound.<br />

node array da da(leda :: node array& na);<br />

3. Operations<br />

introduces a variable da of this class bound to na.<br />

T<br />

void<br />

get(const node array da& da, const Iter& it)<br />

returns the associated value of it for this accessor.<br />

set(node array da& da, const Iter& it, T val)<br />

sets the associated value of it for this accessor to the<br />

given value.

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

Saved successfully!

Ooh no, something went wrong!