equal
deleted
inserted
replaced
32 \endcode |
32 \endcode |
33 (Except matrix maps, they have two key types.) |
33 (Except matrix maps, they have two key types.) |
34 |
34 |
35 To make easy to use them - especially as template parameters - there are <i>map concepts</i> like by graph classes. |
35 To make easy to use them - especially as template parameters - there are <i>map concepts</i> like by graph classes. |
36 <ul> |
36 <ul> |
37 <li>\ref ReadMap - values can be red out with the \c operator[]. |
37 <li>\ref ReadMap - values can be read out with the \c operator[]. |
38 \code value_typed_variable = map_instance[key_value]; \endcode |
38 \code value_typed_variable = map_instance[key_value]; \endcode |
39 </li> |
39 </li> |
40 <li>\ref WriteMap - values can be set with the \c set() member function. |
40 <li>\ref WriteMap - values can be set with the \c set() member function. |
41 \code map_instance.set(key_value, value_typed_expression); \endcode |
41 \code map_instance.set(key_value, value_typed_expression); \endcode |
42 </li> |
42 </li> |
57 Every \ref MappableGraphComponent "mappable" graph class has two public templates: NodeMap<VALUE> and EdgeMap<VALUE> |
57 Every \ref MappableGraphComponent "mappable" graph class has two public templates: NodeMap<VALUE> and EdgeMap<VALUE> |
58 satisfying the \ref GraphMap concept. |
58 satisfying the \ref GraphMap concept. |
59 If you want to assign data to nodes, just declare a NodeMap with the corresponding |
59 If you want to assign data to nodes, just declare a NodeMap with the corresponding |
60 type. As an example, think of a edge-weighted directed graph. |
60 type. As an example, think of a edge-weighted directed graph. |
61 \code ListGraph::EdgeMap<int> weight(graph); \endcode |
61 \code ListGraph::EdgeMap<int> weight(graph); \endcode |
62 You can see that the map needs the graph hows edges will mapped, but nothing more. |
62 You can see that the map needs the graph whose edges will mapped, but nothing more. |
63 |
63 |
64 If the graph class is extendable or erasable the map will automatically follow |
64 If the graph class is extendable or erasable the map will automatically follow |
65 the changes you make. If a new node is added a default value is mapped to it. |
65 the changes you make. If a new node is added a default value is mapped to it. |
66 You can define the default value by passing a second argument to the map's constructor. |
66 You can define the default value by passing a second argument to the map's constructor. |
67 \code ListGraph::EdgeMap<int> weight(graph, 13); \endcode |
67 \code ListGraph::EdgeMap<int> weight(graph, 13); \endcode |