doc/maps.dox
author alpar
Sun, 21 Mar 2004 14:59:51 +0000
changeset 224 5bc1c83257f8
parent 205 992aac9c9541
child 273 e9024dad7fc1
permissions -rw-r--r--
Some doc added
     1 /*!
     2 
     3 \page maps How to write maps
     4 
     5 \section read-maps Readable Maps
     6 
     7 It is quite easy to write your own readmap for the edges or nodes of a graph.
     8 
     9 You can find some example below.
    10 
    11 This simple map assigns \f$\pi\f$ to each edge.
    12 
    13 \code
    14 class MyMap 
    15 {
    16   double operator[](Graph::EdgeIt e) const { return 1;}
    17 };
    18 \endcode
    19 
    20 
    21 Here is a more complex example. It provides a length function which is obtained
    22 from a base length function modified by a potential difference.
    23 \todo Please improve on the english. 
    24 
    25 \code
    26 class MyLengthMap 
    27 {
    28   const Graph::EdgeMap &ol;
    29   const Graph::NodeMap &pot;
    30   
    31   double operator[](Graph::EdgeIt e) const {
    32     return ol.get(e)-pot.get(v)-pot.get(u);
    33   }
    34   
    35   MyComplexMap(const Graph::EdgeMap &o,const Graph::NodeMap &p) :
    36     ol(o), pot(p);
    37 };
    38 \endcode
    39 
    40 */