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.

void A.init(const graph t& G, int n, E x)<br />

bool A.use face data(const graph t& G, E x)<br />

4. Implementation<br />

makes A valid for at most n faces of G and sets A(f) = x<br />

for all faces f of G.<br />

Precondition: n ≥ |V |.<br />

A is also valid for the next n − |V | faces added to G.<br />

use free data slots in the faces of G (if available) for<br />

storing the entries of A. <strong>The</strong> number of additional data<br />

slots in the nodes and edges of a graph can be specified<br />

in the graph ::graph(int n slots, int e slots) constructor.<br />

<strong>The</strong> result is true if a free slot is available and false<br />

otherwise.<br />

Node arrays for a graph G are implemented by C++vectors and an internal numbering of<br />

the faces and edges of G. <strong>The</strong> access operation takes constant time, init takes time O(n),<br />

where n is the number of faces in G. <strong>The</strong> space requirement is O(n).<br />

Remark: A face array is only valid for a bounded number of faces of G. This number is<br />

either the number of faces of G at the moment of creation of the array or it is explicitely<br />

set by the user. Dynamic face arrays can be realized by face maps (cf. section 11.11).

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

Saved successfully!

Ooh no, something went wrong!