src/work/marci/merge_node_graph_wrapper_test.cc
changeset 917 ffb8f0cbcb57
parent 915 751ed145bdae
child 921 818510fa3d99
     1.1 --- a/src/work/marci/merge_node_graph_wrapper_test.cc	Tue Sep 28 16:40:55 2004 +0000
     1.2 +++ b/src/work/marci/merge_node_graph_wrapper_test.cc	Tue Sep 28 17:00:18 2004 +0000
     1.3 @@ -10,17 +10,32 @@
     1.4  using namespace hugo;
     1.5  
     1.6  int main() {
     1.7 -  SmartGraph g;
     1.8 -  ListGraph h;
     1.9 -  typedef MergeNodeGraphWrapper<SmartGraph, ListGraph> GW;
    1.10 +  typedef SmartGraph Graph1;
    1.11 +  typedef ListGraph Graph2;
    1.12 +  Graph1 g;
    1.13 +  Graph2 h;
    1.14 +  typedef MergeNodeGraphWrapper<Graph1, Graph2> GW;
    1.15    GW gw(g, h);
    1.16 -  g.addNode();
    1.17 -  g.addNode();
    1.18 -  g.addNode();
    1.19 -  h.addNode();
    1.20 -  h.addNode();
    1.21 +  Graph1::Node n1=g.addNode();
    1.22 +  Graph1::Node n2=g.addNode();
    1.23 +  Graph1::Node n3=g.addNode();
    1.24 +  Graph2::Node n4=h.addNode();
    1.25 +  Graph2::Node n5=h.addNode();
    1.26    //GW::NodeIt n(gw)
    1.27    for (GW::NodeIt n(gw); n!=INVALID; ++n) { 
    1.28      cout << gw.id(n) << endl;
    1.29    }
    1.30 +
    1.31 +  GW::NodeMap<int> nm(gw);
    1.32 +  int i=0;
    1.33 +  for (GW::NodeIt n(gw); n!=INVALID; ++n) { 
    1.34 +    ++i;
    1.35 +    nm.set(n, i);
    1.36 +  }
    1.37 +  for (Graph1::NodeIt n(g); n!=INVALID; ++n) { 
    1.38 +    cout << nm[n] << endl;
    1.39 +  }
    1.40 +  for (Graph2::NodeIt n(h); n!=INVALID; ++n) { 
    1.41 +    cout << nm[n] << endl;
    1.42 +  }
    1.43  }