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.

11.11 Node Maps ( node map )<br />

1. Definition<br />

An instance of the data type node map is a map for the nodes of a graph G, i.e.,<br />

equivalent to map (cf. 7.4). It can be used as a dynamic variant of the data<br />

type node array (cf. 11.8). New: Since node map is derived from node array<br />

node maps can be passed (by reference) to functions with node array parameters. In<br />

particular, all <strong>LEDA</strong> graph algorithms expecting a node array& argument can be<br />

passed a node map instead.<br />

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

2. Creation<br />

node map M;<br />

introduces a variable M of type node map and initializes it to<br />

the map with empty domain.<br />

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

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

3. Operations<br />

introduces a variable M of type node map and initializes it with<br />

a mapping m from the set of all nodes of G into the set of variables<br />

of type E. <strong>The</strong> variables in the range of m are initialized by a call<br />

of the default constructor of type E.<br />

introduces a variable M of type node map and initializes it with<br />

a mapping m from the set of all nodes of G into the set of variables<br />

of type E. <strong>The</strong> variables in the range of m are initialized with a<br />

copy of x.<br />

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

void M.init( ) makes M a node map with empty domain.<br />

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

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

makes M a mapping m from the set of all nodes of G into<br />

the set of variables of type E. <strong>The</strong> variables in the range<br />

of m are initialized by a call of the default constructor of<br />

type E.<br />

makes M a mapping m from the set of all nodes of G into<br />

the set of variables of type E. <strong>The</strong> variables in the range<br />

of m are initialized with a copy of x.

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

Saved successfully!

Ooh no, something went wrong!