doc/maps.dox
changeset 2634 e98bbe64cca4
parent 2553 bfced05fa852
equal deleted inserted replaced
21:269fff147057 22:66f2f5aa5052
   104 \code
   104 \code
   105 struct MyMap 
   105 struct MyMap 
   106 {
   106 {
   107   typedef double Value;
   107   typedef double Value;
   108   typedef Graph::Edge Key;
   108   typedef Graph::Edge Key;
   109   double operator[](Key e) const { return M_PI;}
   109   double operator[](Key e) const { return PI;}
   110 };
   110 };
   111 \endcode
   111 \endcode
   112 
   112 
   113 An alternative way to define maps is to use \c MapBase
   113 An alternative way to define maps is to use \c MapBase
   114 
   114 
   115 \code
   115 \code
   116 struct MyMap : public MapBase<Graph::Edge,double>
   116 struct MyMap : public MapBase<Graph::Edge,double>
   117 {
   117 {
   118   Value operator[](Key e) const { return M_PI;}
   118   Value operator[](Key e) const { return PI;}
   119 };
   119 };
   120 \endcode
   120 \endcode
   121 
   121 
   122 Here is a bit more complex example.
   122 Here is a bit more complex example.
   123 It provides a length function obtained
   123 It provides a length function obtained