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.

11.10 Face Arrays ( face array )<br />

1. Definition<br />

An instance A of the parameterized data type face array is a partial mapping from<br />

the face set of a graph G to the set of variables of type E, called the element type of the<br />

array. <strong>The</strong> domain I of A is called the index set of A and A(f) is called the element at<br />

position f. A is said to be valid for all faces in I. <strong>The</strong> array access operator A[f] checks<br />

its precondition (A must be valid for f). <strong>The</strong> check can be turned off by compiling with<br />

the flag -D<strong>LEDA</strong>_CHECKING_OFF.<br />

#include < <strong>LEDA</strong>/graph/face array.h ><br />

2. Creation<br />

face array A;<br />

creates an instance A of type face array with empty index set.<br />

face array A(const graph t& G);<br />

face array A(const graph t& G, E x);<br />

creates an instance A of type face array and initializes the index<br />

set of A to the current face set of graph G.<br />

creates an instance A of type face array, sets the index set of<br />

A to the current face set of graph G and initializes A(f) with x for<br />

all faces f of G.<br />

face array A(const graph t& G, int n, E x);<br />

creates an instance A of type face array valid for up to n faces<br />

of graph G and initializes A(f) with x 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 />

3. Operations<br />

const graph t& A.get graph( ) returns a reference to the graph of A.<br />

E& A[face f] returns the variable A(f).<br />

Precondition: A must be valid for f.<br />

void<br />

A.init(const graph t& G) sets the index set I of A to the face set of G, i.e., makes<br />

A valid for all faces of G.<br />

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

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

all faces f of G.

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

Saved successfully!

Ooh no, something went wrong!