COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
09/28/04 19:00:18 (16 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1228
Message:

merge_node_graph_wrapper::nodemap

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/marci/merge_node_graph_wrapper_test.cc

    r915 r917  
    1111
    1212int main() {
    13   SmartGraph g;
    14   ListGraph h;
    15   typedef MergeNodeGraphWrapper<SmartGraph, ListGraph> GW;
     13  typedef SmartGraph Graph1;
     14  typedef ListGraph Graph2;
     15  Graph1 g;
     16  Graph2 h;
     17  typedef MergeNodeGraphWrapper<Graph1, Graph2> GW;
    1618  GW gw(g, h);
    17   g.addNode();
    18   g.addNode();
    19   g.addNode();
    20   h.addNode();
    21   h.addNode();
     19  Graph1::Node n1=g.addNode();
     20  Graph1::Node n2=g.addNode();
     21  Graph1::Node n3=g.addNode();
     22  Graph2::Node n4=h.addNode();
     23  Graph2::Node n5=h.addNode();
    2224  //GW::NodeIt n(gw)
    2325  for (GW::NodeIt n(gw); n!=INVALID; ++n) {
    2426    cout << gw.id(n) << endl;
    2527  }
     28
     29  GW::NodeMap<int> nm(gw);
     30  int i=0;
     31  for (GW::NodeIt n(gw); n!=INVALID; ++n) {
     32    ++i;
     33    nm.set(n, i);
     34  }
     35  for (Graph1::NodeIt n(g); n!=INVALID; ++n) {
     36    cout << nm[n] << endl;
     37  }
     38  for (Graph2::NodeIt n(h); n!=INVALID; ++n) {
     39    cout << nm[n] << endl;
     40  }
    2641}
Note: See TracChangeset for help on using the changeset viewer.