Changeset 289:98adf9276de0 in lemon-0.x
- Timestamp:
- 04/04/04 11:17:58 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@407
- Location:
- doc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/Doxyfile
r274 r289 399 399 ../src/include/bin_heap.h \ 400 400 ../src/include/fib_heap.h \ 401 ../src/ demo/athos/xy/xy.h \401 ../src/work/athos/xy/xy.h \ 402 402 maps.dox 403 403 -
doc/maps.dox
r273 r289 1 1 /*! 2 2 3 \page maps How to write maps3 \page maps How to write your own maps 4 4 5 5 \section read-maps Readable Maps 6 6 7 It is quite easy to write your own readmap for the edges or nodes of a graph. 7 The readable maps are very frequently used as the input of the 8 algorithms. For this purpose the most straightforward is to use the 9 maps provided by Hugo's graph structres. Very often however, it is more 10 convenient and/or more efficient to write your own readable map. 8 11 9 12 You can find some example below. … … 15 18 { 16 19 typedef double ValueType; 17 double operator[](Graph::EdgeIt e) const { return M_PI;} 20 double operator[](Graph::Edge e) const { return M_PI;} 21 }; 22 \endcode 23 24 An alternative way to define maps. For this, \c MapBase seems to 25 be a better name then \c NullMap 26 27 \code 28 struct MyMap : public MapBase<Edge,double> 29 { 30 double operator[](Graph::Edge e) const { return M_PI;} 31 }; 32 \endcode 33 34 Or if we had \c KeyType and \c ValueType 35 36 \code 37 struct MyMap : public MapBase<Edge,double> 38 { 39 ValueType operator[](KeyType e) const { return M_PI;} 18 40 }; 19 41 \endcode … … 22 44 Here is a more complex example. It provides a length function which is obtained 23 45 from a base length function modified by a potential difference. 24 \todo Please improve on the english.25 46 26 47 \code … … 33 54 typedef double ValueType; 34 55 35 double operator[](Graph::Edge Ite) const {56 double operator[](Graph::Edge e) const { 36 57 return ol.get(e)-pot.get(v)-pot.get(u); 37 58 } … … 42 63 \endcode 43 64 65 \todo Please improve on the english. 44 66 \todo Don't we need \e to \e require a 'typedef xxx KeyType' tag, as well? 45 67 */
Note: See TracChangeset
for help on using the changeset viewer.