diff -r a7d5fe18d8f9 -r 3fef334f5f37 src/work/marci/merge_node_graph_wrapper_test.cc --- a/src/work/marci/merge_node_graph_wrapper_test.cc Thu Nov 18 14:37:22 2004 +0000 +++ b/src/work/marci/merge_node_graph_wrapper_test.cc Thu Nov 18 22:31:21 2004 +0000 @@ -4,10 +4,14 @@ #include #include +#include +#include + using std::cout; using std::endl; using namespace lemon; +using namespace lemon::concept; class Graph3 : ListGraph { public: @@ -18,6 +22,11 @@ int main() { typedef SmartGraph Graph1; typedef ListGraph Graph2; + +// { +// checkConcept >(); +// } + { Graph1 g; Graph2 h; typedef MergeNodeGraphWrapper GW; @@ -77,4 +86,56 @@ GW gw(g, h); gw.print(); } + } + { + Graph1 g; + Graph2 h; + typedef Graph1::Node Node1; + typedef Graph2::Node Node2; + typedef NewEdgeSetGraphWrapper GW; + Graph1::NodeMap e_node(g); + Graph2::NodeMap n_node(h); + GW gw(g, h, e_node, n_node); + for (int i=0; i<4; ++i) { + Node1 n=g.addNode(); + e_node.set(n, INVALID); + } + for (int i=0; i<4; ++i) { + Graph1::Node n1=g.addNode(); + Graph2::Node n2=h.addNode(); + e_node.set(n1, n2); + n_node.set(n2, n1); + } + for (Graph2::NodeIt n(h); n!=INVALID; ++n) + for (Graph2::NodeIt m(h); m!=INVALID; ++m) + if ((h.id(n)+h.id(m))%3==0) h.addEdge(n, m); +// Graph1::NodeIt n(g); +// Node1 n1=n; +// Node1 n2=++n; +// Node1 n3=++n; +// Node1 n4=n; +// gw.addEdge(n1, n2); +// gw.addEdge(n1, n2); +// for (EdgeIt(e)) +// Graph1::Node n1=g.addNode(); +// Graph1::Node n2=g.addNode(); +// Graph1::Node n3=g.addNode(); +// Graph2::Node n4=h.addNode(); +// Graph2::Node n5=h.addNode(); + for (GW::EdgeIt e(gw); e!=INVALID; ++e) + cout << gw.id(e) << endl; + for (GW::NodeIt n(gw); n!=INVALID; ++n) { + if (e_node[n]==INVALID) { + cout<