Some improvements and proposals in map.doc.
demo -> work in Doxyfile.
1.1 --- a/doc/Doxyfile Sun Apr 04 09:16:35 2004 +0000
1.2 +++ b/doc/Doxyfile Sun Apr 04 09:17:58 2004 +0000
1.3 @@ -398,7 +398,7 @@
1.4 ../src/include/dijkstra.h \
1.5 ../src/include/bin_heap.h \
1.6 ../src/include/fib_heap.h \
1.7 - ../src/demo/athos/xy/xy.h \
1.8 + ../src/work/athos/xy/xy.h \
1.9 maps.dox
1.10
1.11 # If the value of the INPUT tag contains directories, you can use the
2.1 --- a/doc/maps.dox Sun Apr 04 09:16:35 2004 +0000
2.2 +++ b/doc/maps.dox Sun Apr 04 09:17:58 2004 +0000
2.3 @@ -1,10 +1,13 @@
2.4 /*!
2.5
2.6 -\page maps How to write maps
2.7 +\page maps How to write your own maps
2.8
2.9 \section read-maps Readable Maps
2.10
2.11 -It is quite easy to write your own readmap for the edges or nodes of a graph.
2.12 +The readable maps are very frequently used as the input of the
2.13 +algorithms. For this purpose the most straightforward is to use the
2.14 +maps provided by Hugo's graph structres. Very often however, it is more
2.15 +convenient and/or more efficient to write your own readable map.
2.16
2.17 You can find some example below.
2.18
2.19 @@ -14,14 +17,32 @@
2.20 struct MyMap
2.21 {
2.22 typedef double ValueType;
2.23 - double operator[](Graph::EdgeIt e) const { return M_PI;}
2.24 + double operator[](Graph::Edge e) const { return M_PI;}
2.25 };
2.26 \endcode
2.27
2.28 +An alternative way to define maps. For this, \c MapBase seems to
2.29 +be a better name then \c NullMap
2.30 +
2.31 +\code
2.32 +struct MyMap : public MapBase<Edge,double>
2.33 +{
2.34 + double operator[](Graph::Edge e) const { return M_PI;}
2.35 +};
2.36 +\endcode
2.37 +
2.38 +Or if we had \c KeyType and \c ValueType
2.39 +
2.40 +\code
2.41 +struct MyMap : public MapBase<Edge,double>
2.42 +{
2.43 + ValueType operator[](KeyType e) const { return M_PI;}
2.44 +};
2.45 +\endcode
2.46 +
2.47
2.48 Here is a more complex example. It provides a length function which is obtained
2.49 from a base length function modified by a potential difference.
2.50 -\todo Please improve on the english.
2.51
2.52 \code
2.53 class MyLengthMap
2.54 @@ -32,7 +53,7 @@
2.55 public:
2.56 typedef double ValueType;
2.57
2.58 - double operator[](Graph::EdgeIt e) const {
2.59 + double operator[](Graph::Edge e) const {
2.60 return ol.get(e)-pot.get(v)-pot.get(u);
2.61 }
2.62
2.63 @@ -41,5 +62,6 @@
2.64 };
2.65 \endcode
2.66
2.67 +\todo Please improve on the english.
2.68 \todo Don't we need \e to \e require a 'typedef xxx KeyType' tag, as well?
2.69 */