equal
deleted
inserted
replaced
40 \code |
40 \code |
41 struct MyMap |
41 struct MyMap |
42 { |
42 { |
43 typedef double Value; |
43 typedef double Value; |
44 typedef Graph::Edge Key; |
44 typedef Graph::Edge Key; |
45 double operator[](const Key &e) const { return M_PI;} |
45 double operator[](const Key &e) const { return PI;} |
46 }; |
46 }; |
47 \endcode |
47 \endcode |
48 |
48 |
49 An alternative way to define maps is to use MapBase |
49 An alternative way to define maps is to use MapBase |
50 |
50 |
51 \code |
51 \code |
52 struct MyMap : public MapBase<Graph::Edge,double> |
52 struct MyMap : public MapBase<Graph::Edge,double> |
53 { |
53 { |
54 Value operator[](const Key& e) const { return M_PI;} |
54 Value operator[](const Key& e) const { return PI;} |
55 }; |
55 }; |
56 \endcode |
56 \endcode |
57 |
57 |
58 Here is a bit more complex example. |
58 Here is a bit more complex example. |
59 It provides a length function obtained |
59 It provides a length function obtained |