# HG changeset patch # User alpar # Date 1081070278 0 # Node ID 98adf9276de069eb22e7865a105451dfe8f84edf # Parent 84e75e8f2fd2e5216d8c8e00a7be4f9eb86d6963 Some improvements and proposals in map.doc. demo -> work in Doxyfile. diff -r 84e75e8f2fd2 -r 98adf9276de0 doc/Doxyfile --- a/doc/Doxyfile Sun Apr 04 09:16:35 2004 +0000 +++ b/doc/Doxyfile Sun Apr 04 09:17:58 2004 +0000 @@ -398,7 +398,7 @@ ../src/include/dijkstra.h \ ../src/include/bin_heap.h \ ../src/include/fib_heap.h \ - ../src/demo/athos/xy/xy.h \ + ../src/work/athos/xy/xy.h \ maps.dox # If the value of the INPUT tag contains directories, you can use the diff -r 84e75e8f2fd2 -r 98adf9276de0 doc/maps.dox --- a/doc/maps.dox Sun Apr 04 09:16:35 2004 +0000 +++ b/doc/maps.dox Sun Apr 04 09:17:58 2004 +0000 @@ -1,10 +1,13 @@ /*! -\page maps How to write maps +\page maps How to write your own maps \section read-maps Readable Maps -It is quite easy to write your own readmap for the edges or nodes of a graph. +The readable maps are very frequently used as the input of the +algorithms. For this purpose the most straightforward is to use the +maps provided by Hugo's graph structres. Very often however, it is more +convenient and/or more efficient to write your own readable map. You can find some example below. @@ -14,14 +17,32 @@ struct MyMap { typedef double ValueType; - double operator[](Graph::EdgeIt e) const { return M_PI;} + double operator[](Graph::Edge e) const { return M_PI;} }; \endcode +An alternative way to define maps. For this, \c MapBase seems to +be a better name then \c NullMap + +\code +struct MyMap : public MapBase +{ + double operator[](Graph::Edge e) const { return M_PI;} +}; +\endcode + +Or if we had \c KeyType and \c ValueType + +\code +struct MyMap : public MapBase +{ + ValueType operator[](KeyType e) const { return M_PI;} +}; +\endcode + Here is a more complex example. It provides a length function which is obtained from a base length function modified by a potential difference. -\todo Please improve on the english. \code class MyLengthMap @@ -32,7 +53,7 @@ public: typedef double ValueType; - double operator[](Graph::EdgeIt e) const { + double operator[](Graph::Edge e) const { return ol.get(e)-pot.get(v)-pot.get(u); } @@ -41,5 +62,6 @@ }; \endcode +\todo Please improve on the english. \todo Don't we need \e to \e require a 'typedef xxx KeyType' tag, as well? */