next up previous contents index
Next: Two Dimensional Node Arrays Up: Graphs and Related Data Previous: Edge Maps ( edge_map   Contents   Index


Face Maps ( face_map )

Definition

An instance of the data type face_map<E> is a map for the faces of a graph G, i.e., equivalent to map<face,E> (cf. Maps). It can be used as a dynamic variant of the data type face_array (cf. Face Arrays). New: Since face_map<E> is derived from face_array<E> face maps can be passed (by reference) to functions with face array parameters. In particular, all LEDA graph algorithms expecting a face_array<E>& argument can be passed a face_map<E> instead.

#include < LEDA/graph/face_map.h >

Creation

face_map<E> M introduces a variable M of type face_map<E> and initializes it to the map with empty domain.

face_map<E> M(const graph_t& G) introduces a variable M of type face_map<E> and initializes it with a mapping m from the set of all faces of G into the set of variables of type E. The variables in the range of m are initialized by a call of the default constructor of type E.

face_map<E> M(const graph_t& G, E x) introduces a variable M of type face_map<E> and initializes it with a mapping m from the set of all faces of G into the set of variables of type E. The variables in the range of m are initialized with a copy of x.

Operations

const graph_t& M.get_graph() returns a reference to the graph of M.

void M.init() makes M a face map with empty domain.

void M.init(const graph_t& G) makes M a mapping m from the set of all faces of G into the set of variables of type E. The variables in the range of m are initialized by a call of the default constructor of type E.

void M.init(const graph_t& G, E x)
    makes M a mapping m from the set of all faces of G into the set of variables of type E. The variables in the range of m are initialized with a copy of x.

E& M[face f] returns the variable M(v).

Implementation

Face maps are implemented by an efficient hashing method based on the internal numbering of the faces. An access operation takes expected time O(1).


next up previous contents index
Next: Two Dimensional Node Arrays Up: Graphs and Related Data Previous: Edge Maps ( edge_map   Contents   Index
root 2008-01-09