# Changeset 289:98adf9276de0 in lemon-0.x for doc/maps.dox

Ignore:
Timestamp:
04/04/04 11:17:58 (16 years ago)
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@407
Message:

Some improvements and proposals in map.doc.
demo -> work in Doxyfile.

File:
1 edited

Unmodified
Added
Removed
• ## doc/maps.dox

 r273 /*! \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. { 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 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); } \endcode \todo Please improve on the english. \todo Don't we need \e to \e require a 'typedef xxx KeyType' tag, as well? */
Note: See TracChangeset for help on using the changeset viewer.