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.12 Edge Maps ( edge map )<br />

1. Definition<br />

An instance of the data type edge map is a map for the edges 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 edge array (cf. 11.9). New: Since edge map is derived from edge array edge<br />

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

all <strong>LEDA</strong> graph algorithms expecting an edge array& argument can be passed an<br />

edge map& instead.<br />

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

2. Creation<br />

edge map M;<br />

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

the map with empty domain.<br />

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

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

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

a mapping m from the set of all edges 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 edge map and initializes it with<br />

a mapping m from the set of all edges 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 />

3. Operations<br />

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

void M.init( ) makes M a edge 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 edges 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 edges 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!