COIN-OR::LEMON - Graph Library

Changeset 648:8c13444bccf6 in lemon-0.x for src/work/marci


Ignore:
Timestamp:
05/19/04 18:20:10 (20 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@848
Message:

for_each fix

Location:
src/work/marci/leda
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/work/marci/leda/bipartite_matching_leda.cc

    r616 r648  
    1111
    1212#include <leda_graph_wrapper.h>
    13 #include <list_graph.h>
     13#include <sage_graph.h>
    1414//#include <smart_graph.h>
    1515//#include <dimacs.h>
    1616#include <hugo/time_measure.h>
    17 #include <for_each_macros.h>
     17#include <hugo/for_each_macros.h>
    1818#include <hugo/graph_wrapper.h>
    1919#include <bipartite_graph_wrapper.h>
     
    5252  Graph g(lg);
    5353
    54   //for UndirListGraph
    55   //typedef UndirListGraph Graph;
     54  //for UndirSageGraph
     55  //typedef UndirSageGraph Graph;
    5656  //Graph g;
    5757
     
    108108  FOR_EACH_LOC(stGW::EdgeIt, e, stgw) flow.set(e, 0);
    109109//  while (max_flow_test.augmentOnShortestPath()) { }
    110   typedef ListGraph MutableGraph;
     110  typedef SageGraph MutableGraph;
    111111//  while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) {
    112112  while (max_flow_test.augmentOnBlockingFlow2()) {
  • src/work/marci/leda/bipartite_matching_leda_gen.cc

    r616 r648  
    1111
    1212#include <leda_graph_wrapper.h>
    13 #include <list_graph.h>
     13#include <sage_graph.h>
    1414//#include <smart_graph.h>
    1515//#include <dimacs.h>
    1616#include <hugo/time_measure.h>
    17 #include <for_each_macros.h>
     17#include <hugo/for_each_macros.h>
    1818#include <hugo/graph_wrapper.h>
    1919#include <bipartite_graph_wrapper.h>
     
    5252  Graph g(lg);
    5353
    54   //for UndirListGraph
    55   //typedef UndirListGraph Graph;
     54  //for UndirSageGraph
     55  //typedef UndirSageGraph Graph;
    5656  //Graph g;
    5757
     
    125125  ts.reset();
    126126  FOR_EACH_LOC(stGW::EdgeIt, e, stgw) flow.set(e, 0);
    127   typedef ListGraph MutableGraph;
     127  typedef SageGraph MutableGraph;
    128128  while (max_flow_test.augmentOnBlockingFlow<MutableGraph>()) { }
    129129  std::cout << "HUGO max matching algorithm based on blocking flow augmentation."
  • src/work/marci/leda/comparison.cc

    r617 r648  
    1111
    1212#include <leda_graph_wrapper.h>
    13 #include <list_graph.h>
     13#include <sage_graph.h>
    1414//#include <smart_graph.h>
    1515//#include <dimacs.h>
    1616#include <hugo/time_measure.h>
    17 #include <for_each_macros.h>
     17#include <hugo/for_each_macros.h>
    1818#include <hugo/graph_wrapper.h>
    1919#include <bipartite_graph_wrapper.h>
     
    5252  Graph g(lg);
    5353
    54   //for UndirListGraph
    55   //typedef UndirListGraph Graph;
     54  //for UndirSageGraph
     55  //typedef UndirSageGraph Graph;
    5656  //Graph g;
    5757
     
    124124//   ts.reset();
    125125//   FOR_EACH_LOC(stGW::EdgeIt, e, stgw) flow.set(e, 0);
    126 //   typedef ListGraph MutableGraph;
     126//   typedef SageGraph MutableGraph;
    127127//   while (max_flow_test.augmentOnBlockingFlow<MutableGraph>()) { }
    128128//   std::cout << "HUGO max matching algorithm based on blocking flow augmentation."
     
    132132
    133133  {
    134   ListGraph hg;
    135   ListGraph::Node s=hg.addNode(); 
    136   ListGraph::Node t=hg.addNode();
    137   BGW::NodeMap<ListGraph::Node> b_s_nodes(bgw); 
    138   BGW::NodeMap<ListGraph::Node> b_t_nodes(bgw);
     134  SageGraph hg;
     135  SageGraph::Node s=hg.addNode(); 
     136  SageGraph::Node t=hg.addNode();
     137  BGW::NodeMap<SageGraph::Node> b_s_nodes(bgw); 
     138  BGW::NodeMap<SageGraph::Node> b_t_nodes(bgw);
    139139 
    140140  FOR_EACH_INC_LOC(BGW::ClassNodeIt, n, bgw, BGW::S_CLASS) {
     
    150150    hg.addEdge(b_s_nodes[bgw.tail(e)], b_t_nodes[bgw.head(e)]);
    151151
    152   ConstMap<ListGraph::Edge, int> cm(1);
    153   ListGraph::EdgeMap<int> flow(hg); //0
     152  ConstMap<SageGraph::Edge, int> cm(1);
     153  SageGraph::EdgeMap<int> flow(hg); //0
    154154 
    155155  Timer ts;
    156156
    157157  ts.reset();
    158   MaxFlow<ListGraph, int, ConstMap<ListGraph::Edge, int>,
    159     ListGraph::EdgeMap<int> >
     158  MaxFlow<SageGraph, int, ConstMap<SageGraph::Edge, int>,
     159    SageGraph::EdgeMap<int> >
    160160    max_flow_test(hg, s, t, cm, flow);
    161161  max_flow_test.run();
    162   std::cout << "HUGO max matching algorithm on ListGraph by copying the graph, based on preflow."
     162  std::cout << "HUGO max matching algorithm on SageGraph by copying the graph, based on preflow."
    163163            << std::endl
    164164            << "Size of matching: "
Note: See TracChangeset for help on using the changeset viewer.