doc/maps.dox
changeset 204 d8107ae24128
parent 202 0bd4fe53b1d0
child 205 992aac9c9541
equal deleted inserted replaced
0:11d99450dcb3 1:bb3b33770333
     6 
     6 
     7 It is quite easy to write your own readmap for the edges or nodes of a graph.
     7 It is quite easy to write your own readmap for the edges or nodes of a graph.
     8 
     8 
     9 You can find some example below.
     9 You can find some example below.
    10 
    10 
       
    11 This simple map assigns \f$\pi\f$ to each edge.
       
    12 
    11 \code
    13 \code
    12 class MyMap 
    14 class MyMap 
    13 {
    15 {
    14   double get(Graph::EdgeIt e) { return 1;}
    16   double get(Graph::EdgeIt e) { return M_PI;}
    15 };
    17 };
    16 \endcode
    18 \endcode
       
    19 
       
    20 Or if we accept the new map style, it will look like this:
       
    21 
       
    22 \code
       
    23 class MyMap 
       
    24 {
       
    25   double operator[](Graph::EdgeIt e) { return 1;}
       
    26 };
       
    27 \endcode
       
    28 
    17 
    29 
    18 A more complex example
    30 A more complex example
    19 
    31 
    20 \code
    32 \code
    21 class MyLengthMap 
    33 class MyLengthMap