COIN-OR::LEMON - Graph Library

Changeset 1788:614ce2dd3cba in lemon-0.x for doc/maps.dox


Ignore:
Timestamp:
11/14/05 19:34:16 (16 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2329
Message:

Some documentation modifications

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/maps.dox

    r1183 r1788  
    2828\c EdgeMap and \c NodeMap. Both are reference maps and you can easily
    2929assign data to the nodes and to the edges of the graph. For example if you
    30 have a graph \c G defined as
     30have a graph \c g defined as
    3131\code
    32   ListGraph G;
     32  ListGraph g;
    3333\endcode
    3434and you want to assign a floating point value to each edge, you can do
    3535it like this.
    3636\code
    37   ListGraph::EdgeMap<double> length(G);
     37  ListGraph::EdgeMap<double> length(g);
    3838\endcode
    3939Note that you must give the underlying graph to the constructor.
     
    9595An alternative way to define maps is to use \c MapBase
    9696
    97 \todo For this, \c MapBase seems to be a better name then \c NullMap.
    98 
    9997\code
    10098struct MyMap : public MapBase<Graph::Edge,double>
     
    117115public:
    118116  Value operator[](Key e) const {
    119     return orig_len.get(e)-(pot.get(G.target(e))-pot.get(G.source(e)));
     117    return orig_len[e]-(pot[g.target(e)]-pot[g.source(e)]);
    120118  }
    121119 
    122120  ReducedLengthMap(const Graph &_g,
    123                    const Graph::EdgeMap &o,
    124                    const Graph::NodeMap &p)
    125     : G(g), orig_len(o), pot(p) {};
     121                   const Graph::EdgeMap &_o,
     122                   const Graph::NodeMap &_p)
     123    : g(_g), orig_len(_o), pot(_p) {};
    126124};
    127125\endcode
Note: See TracChangeset for help on using the changeset viewer.