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).
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(graph 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(graph 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
graph | M.get_graph() | returns a reference to the graph of A. |
void | M.init() | makes M a face map with empty domain. |
void | M.init(graph 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(graph 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(f). |
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).