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.14 Two Dimensional Node Arrays ( node matrix<br />

)<br />

1. Definition<br />

An instance M of the parameterized data type node matrix is a partial mapping from<br />

the set of node pairs V × V of a graph to the set of variables of data type E, called the<br />

element type of M. <strong>The</strong> domain I of M is called the index set of M. M is said to be valid<br />

for all node pairs in I. A node matrix can also be viewed as a node array with element<br />

type node array (node array).<br />

#include < <strong>LEDA</strong>/graph/node matrix.h ><br />

2. Creation<br />

node matrix M; creates an instance M of type node matrix and initializes the<br />

index set of M to the empty set.<br />

node matrix M(const graph t& G);<br />

creates an instance M of type node matrix and initializes the<br />

index set to be the set of all node pairs of graph G, i.e., M is made<br />

valid for all pairs in V × V where V is the set of nodes currently<br />

contained in G.<br />

node matrix M(const graph t& G, E x);<br />

creates an instance M of type node matrix and initializes the<br />

index set of M to be the set of all node pairs of graph G, i.e., M<br />

is made valid for all pairs in V × V where V is the set of nodes<br />

currently contained in G. In addition, M(v, w) is initialized with x<br />

for all nodes v, w ∈ V .<br />

3. Operations<br />

void M.init(const graph t& G)<br />

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

sets the index set of M to V × V , where V is the<br />

set of all nodes of G.<br />

sets the index set of M to V × V , where V is the<br />

set of all nodes of G and initializes M(v, w) to x<br />

for all v, w ∈ V .<br />

const node array& M[node v]<br />

returns the node array M(v).<br />

const E&<br />

M(node v, node w) returns the variable M(v, w).<br />

Precondition: M must be valid for v and w.

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

Saved successfully!

Ooh no, something went wrong!