COIN-OR::LEMON - Graph Library

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


Ignore:
Timestamp:
04/04/04 11:17:58 (16 years ago)
Author:
Alpar Juttner
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

Legend:

Unmodified
Added
Removed
  • doc/maps.dox

    r273 r289  
    11/*!
    22
    3 \page maps How to write maps
     3\page maps How to write your own maps
    44
    55\section read-maps Readable Maps
    66
    7 It is quite easy to write your own readmap for the edges or nodes of a graph.
     7The readable maps are very frequently used as the input of the
     8algorithms.  For this purpose the most straightforward is to use the
     9maps provided by Hugo's graph structres. Very often however, it is more
     10convenient and/or more efficient to write your own readable map.
    811
    912You can find some example below.
     
    1518{
    1619  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
     24An alternative way to define maps. For this, \c MapBase seems to
     25be a better name then \c NullMap
     26
     27\code
     28struct MyMap : public MapBase<Edge,double>
     29{
     30  double operator[](Graph::Edge e) const { return M_PI;}
     31};
     32\endcode
     33
     34Or if we had \c KeyType and \c ValueType
     35
     36\code
     37struct MyMap : public MapBase<Edge,double>
     38{
     39  ValueType operator[](KeyType e) const { return M_PI;}
    1840};
    1941\endcode
     
    2244Here is a more complex example. It provides a length function which is obtained
    2345from a base length function modified by a potential difference.
    24 \todo Please improve on the english.
    2546
    2647\code
     
    3354  typedef double ValueType;
    3455
    35   double operator[](Graph::EdgeIt e) const {
     56  double operator[](Graph::Edge e) const {
    3657    return ol.get(e)-pot.get(v)-pot.get(u);
    3758  }
     
    4263\endcode
    4364
     65\todo Please improve on the english.
    4466\todo Don't we need \e to \e require a 'typedef xxx KeyType' tag, as well?
    4567*/
Note: See TracChangeset for help on using the changeset viewer.