for_each fix
authormarci
Wed, 19 May 2004 16:20:10 +0000
changeset 6488c13444bccf6
parent 647 19dd325da0e8
child 649 ce74706e924d
for_each fix
src/work/marci/leda/bipartite_matching_leda.cc
src/work/marci/leda/bipartite_matching_leda_gen.cc
src/work/marci/leda/comparison.cc
     1.1 --- a/src/work/marci/leda/bipartite_matching_leda.cc	Wed May 19 16:09:38 2004 +0000
     1.2 +++ b/src/work/marci/leda/bipartite_matching_leda.cc	Wed May 19 16:20:10 2004 +0000
     1.3 @@ -10,11 +10,11 @@
     1.4  #include <LEDA/graph_gen.h>
     1.5  
     1.6  #include <leda_graph_wrapper.h>
     1.7 -#include <list_graph.h>
     1.8 +#include <sage_graph.h>
     1.9  //#include <smart_graph.h>
    1.10  //#include <dimacs.h>
    1.11  #include <hugo/time_measure.h>
    1.12 -#include <for_each_macros.h>
    1.13 +#include <hugo/for_each_macros.h>
    1.14  #include <hugo/graph_wrapper.h>
    1.15  #include <bipartite_graph_wrapper.h>
    1.16  #include <hugo/maps.h>
    1.17 @@ -51,8 +51,8 @@
    1.18    typedef LedaGraphWrapper<leda::graph> Graph;
    1.19    Graph g(lg);
    1.20  
    1.21 -  //for UndirListGraph
    1.22 -  //typedef UndirListGraph Graph; 
    1.23 +  //for UndirSageGraph
    1.24 +  //typedef UndirSageGraph Graph; 
    1.25    //Graph g;
    1.26  
    1.27    typedef Graph::Node Node;
    1.28 @@ -107,7 +107,7 @@
    1.29    ts.reset();
    1.30    FOR_EACH_LOC(stGW::EdgeIt, e, stgw) flow.set(e, 0);
    1.31  //  while (max_flow_test.augmentOnShortestPath()) { }
    1.32 -  typedef ListGraph MutableGraph;
    1.33 +  typedef SageGraph MutableGraph;
    1.34  //  while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) {
    1.35    while (max_flow_test.augmentOnBlockingFlow2()) {
    1.36     std::cout << max_flow_test.flowValue() << std::endl;
     2.1 --- a/src/work/marci/leda/bipartite_matching_leda_gen.cc	Wed May 19 16:09:38 2004 +0000
     2.2 +++ b/src/work/marci/leda/bipartite_matching_leda_gen.cc	Wed May 19 16:20:10 2004 +0000
     2.3 @@ -10,11 +10,11 @@
     2.4  #include <LEDA/graph_gen.h>
     2.5  
     2.6  #include <leda_graph_wrapper.h>
     2.7 -#include <list_graph.h>
     2.8 +#include <sage_graph.h>
     2.9  //#include <smart_graph.h>
    2.10  //#include <dimacs.h>
    2.11  #include <hugo/time_measure.h>
    2.12 -#include <for_each_macros.h>
    2.13 +#include <hugo/for_each_macros.h>
    2.14  #include <hugo/graph_wrapper.h>
    2.15  #include <bipartite_graph_wrapper.h>
    2.16  #include <hugo/maps.h>
    2.17 @@ -51,8 +51,8 @@
    2.18    typedef LedaGraphWrapper<leda::graph> Graph;
    2.19    Graph g(lg);
    2.20  
    2.21 -  //for UndirListGraph
    2.22 -  //typedef UndirListGraph Graph; 
    2.23 +  //for UndirSageGraph
    2.24 +  //typedef UndirSageGraph Graph; 
    2.25    //Graph g;
    2.26  
    2.27    typedef Graph::Node Node;
    2.28 @@ -124,7 +124,7 @@
    2.29  
    2.30    ts.reset();
    2.31    FOR_EACH_LOC(stGW::EdgeIt, e, stgw) flow.set(e, 0);
    2.32 -  typedef ListGraph MutableGraph;
    2.33 +  typedef SageGraph MutableGraph;
    2.34    while (max_flow_test.augmentOnBlockingFlow<MutableGraph>()) { }
    2.35    std::cout << "HUGO max matching algorithm based on blocking flow augmentation." 
    2.36  	    << std::endl << "Matching size: " 
     3.1 --- a/src/work/marci/leda/comparison.cc	Wed May 19 16:09:38 2004 +0000
     3.2 +++ b/src/work/marci/leda/comparison.cc	Wed May 19 16:20:10 2004 +0000
     3.3 @@ -10,11 +10,11 @@
     3.4  #include <LEDA/graph_gen.h>
     3.5  
     3.6  #include <leda_graph_wrapper.h>
     3.7 -#include <list_graph.h>
     3.8 +#include <sage_graph.h>
     3.9  //#include <smart_graph.h>
    3.10  //#include <dimacs.h>
    3.11  #include <hugo/time_measure.h>
    3.12 -#include <for_each_macros.h>
    3.13 +#include <hugo/for_each_macros.h>
    3.14  #include <hugo/graph_wrapper.h>
    3.15  #include <bipartite_graph_wrapper.h>
    3.16  #include <hugo/maps.h>
    3.17 @@ -51,8 +51,8 @@
    3.18    typedef LedaGraphWrapper<leda::graph> Graph;
    3.19    Graph g(lg);
    3.20  
    3.21 -  //for UndirListGraph
    3.22 -  //typedef UndirListGraph Graph; 
    3.23 +  //for UndirSageGraph
    3.24 +  //typedef UndirSageGraph Graph; 
    3.25    //Graph g;
    3.26  
    3.27    typedef Graph::Node Node;
    3.28 @@ -123,7 +123,7 @@
    3.29  
    3.30  //   ts.reset();
    3.31  //   FOR_EACH_LOC(stGW::EdgeIt, e, stgw) flow.set(e, 0);
    3.32 -//   typedef ListGraph MutableGraph;
    3.33 +//   typedef SageGraph MutableGraph;
    3.34  //   while (max_flow_test.augmentOnBlockingFlow<MutableGraph>()) { }
    3.35  //   std::cout << "HUGO max matching algorithm based on blocking flow augmentation." 
    3.36  // 	    << std::endl << "Matching size: " 
    3.37 @@ -131,11 +131,11 @@
    3.38  //   std::cout << "elapsed time: " << ts << std::endl << std::endl;
    3.39  
    3.40    {
    3.41 -  ListGraph hg;
    3.42 -  ListGraph::Node s=hg.addNode();  
    3.43 -  ListGraph::Node t=hg.addNode();
    3.44 -  BGW::NodeMap<ListGraph::Node> b_s_nodes(bgw);  
    3.45 -  BGW::NodeMap<ListGraph::Node> b_t_nodes(bgw);
    3.46 +  SageGraph hg;
    3.47 +  SageGraph::Node s=hg.addNode();  
    3.48 +  SageGraph::Node t=hg.addNode();
    3.49 +  BGW::NodeMap<SageGraph::Node> b_s_nodes(bgw);  
    3.50 +  BGW::NodeMap<SageGraph::Node> b_t_nodes(bgw);
    3.51    
    3.52    FOR_EACH_INC_LOC(BGW::ClassNodeIt, n, bgw, BGW::S_CLASS) {
    3.53      b_s_nodes.set(n, hg.addNode());
    3.54 @@ -149,17 +149,17 @@
    3.55    FOR_EACH_LOC(BGW::EdgeIt, e, bgw) 
    3.56      hg.addEdge(b_s_nodes[bgw.tail(e)], b_t_nodes[bgw.head(e)]);
    3.57  
    3.58 -  ConstMap<ListGraph::Edge, int> cm(1);
    3.59 -  ListGraph::EdgeMap<int> flow(hg); //0
    3.60 +  ConstMap<SageGraph::Edge, int> cm(1);
    3.61 +  SageGraph::EdgeMap<int> flow(hg); //0
    3.62    
    3.63    Timer ts;
    3.64  
    3.65    ts.reset();
    3.66 -  MaxFlow<ListGraph, int, ConstMap<ListGraph::Edge, int>, 
    3.67 -    ListGraph::EdgeMap<int> > 
    3.68 +  MaxFlow<SageGraph, int, ConstMap<SageGraph::Edge, int>, 
    3.69 +    SageGraph::EdgeMap<int> > 
    3.70      max_flow_test(hg, s, t, cm, flow);
    3.71    max_flow_test.run();
    3.72 -  std::cout << "HUGO max matching algorithm on ListGraph by copying the graph, based on preflow." 
    3.73 +  std::cout << "HUGO max matching algorithm on SageGraph by copying the graph, based on preflow." 
    3.74  	    << std::endl 
    3.75  	    << "Size of matching: " 
    3.76  	    << max_flow_test.flowValue() << std::endl;