ResGraphWrapper partial improvement
authormarci
Mon, 29 Mar 2004 16:00:00 +0000
changeset 259509ba9f136d2
parent 258 94bafec4f56f
child 260 fb27d1c7036e
ResGraphWrapper partial improvement
src/work/edmonds_karp.h
src/work/marci/dimacs.h
src/work/marci/graph_wrapper.h
src/work/marci/makefile
src/work/marci/time_measure.h
     1.1 --- a/src/work/edmonds_karp.h	Mon Mar 29 11:08:59 2004 +0000
     1.2 +++ b/src/work/edmonds_karp.h	Mon Mar 29 16:00:00 2004 +0000
     1.3 @@ -1,6 +1,6 @@
     1.4  // -*- c++ -*-
     1.5 -#ifndef EDMONDS_KARP_H
     1.6 -#define EDMONDS_KARP_H
     1.7 +#ifndef HUGO_EDMONDS_KARP_H
     1.8 +#define HUGO_EDMONDS_KARP_H
     1.9  
    1.10  #include <algorithm>
    1.11  #include <list>
    1.12 @@ -1104,4 +1104,4 @@
    1.13  
    1.14  } // namespace hugo
    1.15  
    1.16 -#endif //EDMONDS_KARP_H
    1.17 +#endif //HUGO_EDMONDS_KARP_H
     2.1 --- a/src/work/marci/dimacs.h	Mon Mar 29 11:08:59 2004 +0000
     2.2 +++ b/src/work/marci/dimacs.h	Mon Mar 29 16:00:00 2004 +0000
     2.3 @@ -1,6 +1,6 @@
     2.4  // -*- c++ -*-
     2.5 -#ifndef DIMACS_H
     2.6 -#define DIMACS_H
     2.7 +#ifndef HUGO_DIMACS_H
     2.8 +#define HUGO_DIMACS_H
     2.9  
    2.10  #include <iostream>
    2.11  #include <string>
    2.12 @@ -57,4 +57,4 @@
    2.13    
    2.14  } //namespace hugo
    2.15  
    2.16 -#endif //DIMACS_H
    2.17 +#endif //HUGO_DIMACS_H
     3.1 --- a/src/work/marci/graph_wrapper.h	Mon Mar 29 11:08:59 2004 +0000
     3.2 +++ b/src/work/marci/graph_wrapper.h	Mon Mar 29 16:00:00 2004 +0000
     3.3 @@ -1,6 +1,6 @@
     3.4  // -*- c++ -*-
     3.5 -#ifndef GRAPH_WRAPPER_H
     3.6 -#define GRAPH_WRAPPER_H
     3.7 +#ifndef HUGO_GRAPH_WRAPPER_H
     3.8 +#define HUGO_GRAPH_WRAPPER_H
     3.9  
    3.10  #include <invalid.h>
    3.11  
    3.12 @@ -770,24 +770,26 @@
    3.13    template<typename Graph, typename Number, typename FlowMap, typename CapacityMap>
    3.14    class ResGraphWrapper {
    3.15    public:
    3.16 -    typedef Graph BaseGraph;
    3.17 +    //typedef Graph BaseGraph;
    3.18      typedef typename Graph::Node Node;
    3.19      typedef typename Graph::NodeIt NodeIt;
    3.20    private:
    3.21      typedef typename Graph::OutEdgeIt OldOutEdgeIt;
    3.22      typedef typename Graph::InEdgeIt OldInEdgeIt;
    3.23    protected:
    3.24 -    const Graph* graph;
    3.25 +    //const Graph* graph;
    3.26 +    typedef TrivGraphWrapper<const Graph> GraphWrapper;
    3.27 +    GraphWrapper gw;
    3.28      FlowMap* flow;
    3.29      const CapacityMap* capacity;
    3.30    public:
    3.31  
    3.32      ResGraphWrapper(const Graph& _G, FlowMap& _flow, 
    3.33  	     const CapacityMap& _capacity) : 
    3.34 -      graph(&_G), flow(&_flow), capacity(&_capacity) { }
    3.35 +      gw(_G), flow(&_flow), capacity(&_capacity) { }
    3.36  
    3.37 -    void setGraph(const Graph& _graph) { graph = &_graph; }
    3.38 -    const Graph& getGraph() const { return (*graph); }
    3.39 +    //void setGraph(const Graph& _graph) { graph = &_graph; }
    3.40 +    //const Graph& getGraph() const { return (*graph); }
    3.41  
    3.42      class Edge; 
    3.43      class OutEdgeIt; 
    3.44 @@ -829,12 +831,12 @@
    3.45        OutEdgeIt(const Invalid& i) : Edge(i) { }
    3.46      private:
    3.47        OutEdgeIt(const ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>& resG, Node v) : Edge() { 
    3.48 -	resG.graph->first(out, v);
    3.49 -	while( resG.graph->valid(out) && !(resG.free(out)>0) ) { resG.graph->next(out); }
    3.50 -	if (!resG.graph->valid(out)) {
    3.51 +	resG.gw.first(out, v);
    3.52 +	while( resG.gw.valid(out) && !(resG.free(out)>0) ) { resG.gw.next(out); }
    3.53 +	if (!resG.gw.valid(out)) {
    3.54  	  out_or_in=0;
    3.55 -	  resG.graph->first(in, v);
    3.56 -	  while( resG.graph->valid(in) && !(resG.free(in)>0) ) { resG.graph->next(in); }
    3.57 +	  resG.gw.first(in, v);
    3.58 +	  while( resG.gw.valid(in) && !(resG.free(in)>0) ) { resG.gw.next(in); }
    3.59  	}
    3.60        }
    3.61  //     public:
    3.62 @@ -864,23 +866,23 @@
    3.63        //EdgeIt(const EdgeIt& e) : Edge(e), v(e.v) { }
    3.64        EdgeIt(const Invalid& i) : Edge(i) { }
    3.65        EdgeIt(const ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>& resG) : Edge() { 
    3.66 -	resG.graph->first(v);
    3.67 -	if (resG.graph->valid(v)) resG.graph->first(out, v); else out=OldOutEdgeIt(INVALID);
    3.68 -	while (resG.graph->valid(out) && !(resG.free(out)>0) ) { resG.graph->next(out); }
    3.69 -	while (resG.graph->valid(v) && !resG.graph->valid(out)) { 
    3.70 -	  resG.graph->next(v); 
    3.71 -	  if (resG.graph->valid(v)) resG.graph->first(out, v); 
    3.72 -	  while (resG.graph->valid(out) && !(resG.free(out)>0) ) { resG.graph->next(out); }
    3.73 +	resG.gw.first(v);
    3.74 +	if (resG.gw.valid(v)) resG.gw.first(out, v); else out=/*OldOutEdgeIt*/(INVALID);
    3.75 +	while (resG.gw.valid(out) && !(resG.free(out)>0) ) { resG.gw.next(out); }
    3.76 +	while (resG.gw.valid(v) && !resG.gw.valid(out)) { 
    3.77 +	  resG.gw.next(v); 
    3.78 +	  if (resG.gw.valid(v)) resG.gw.first(out, v); 
    3.79 +	  while (resG.gw.valid(out) && !(resG.free(out)>0) ) { resG.gw.next(out); }
    3.80  	}
    3.81 -	if (!resG.graph->valid(out)) {
    3.82 +	if (!resG.gw.valid(out)) {
    3.83  	  out_or_in=0;
    3.84 -	  resG.graph->first(v);
    3.85 -	  if (resG.graph->valid(v)) resG.graph->first(in, v); else in=OldInEdgeIt(INVALID);
    3.86 -	  while (resG.graph->valid(in) && !(resG.free(in)>0) ) { resG.graph->next(in); }
    3.87 -	  while (resG.graph->valid(v) && !resG.graph->valid(in)) { 
    3.88 -	    resG.graph->next(v); 
    3.89 -	    if (resG.graph->valid(v)) resG.graph->first(in, v); 
    3.90 -	    while (resG.graph->valid(in) && !(resG.free(in)>0) ) { resG.graph->next(in); }
    3.91 +	  resG.gw.first(v);
    3.92 +	  if (resG.gw.valid(v)) resG.gw.first(in, v); else in=/*OldInEdgeIt*/(INVALID);
    3.93 +	  while (resG.gw.valid(in) && !(resG.free(in)>0) ) { resG.gw.next(in); }
    3.94 +	  while (resG.gw.valid(v) && !resG.gw.valid(in)) { 
    3.95 +	    resG.gw.next(v); 
    3.96 +	    if (resG.gw.valid(v)) resG.gw.first(in, v); 
    3.97 +	    while (resG.gw.valid(in) && !(resG.free(in)>0) ) { resG.gw.next(in); }
    3.98  	  }
    3.99  	}
   3.100        }
   3.101 @@ -917,7 +919,7 @@
   3.102  //       }
   3.103      };
   3.104  
   3.105 -    NodeIt& first(NodeIt& v) const { return graph->first(v); }
   3.106 +    NodeIt& first(NodeIt& v) const { return gw.first(v); }
   3.107      OutEdgeIt& first(OutEdgeIt& e, Node v) const { 
   3.108        e=OutEdgeIt(*this, v); 
   3.109        return e;
   3.110 @@ -927,52 +929,52 @@
   3.111        return e;
   3.112      }
   3.113     
   3.114 -    NodeIt& next(NodeIt& n) const { return graph->next(n); }
   3.115 +    NodeIt& next(NodeIt& n) const { return gw.next(n); }
   3.116  
   3.117      OutEdgeIt& next(OutEdgeIt& e) const { 
   3.118        if (e.out_or_in) {
   3.119 -	Node v=graph->aNode(e.out);
   3.120 -	graph->next(e.out);
   3.121 -	while( graph->valid(e.out) && !(free(e.out)>0) ) { graph->next(e.out); }
   3.122 -	if (!graph->valid(e.out)) {
   3.123 +	Node v=gw.aNode(e.out);
   3.124 +	gw.next(e.out);
   3.125 +	while( gw.valid(e.out) && !(free(e.out)>0) ) { gw.next(e.out); }
   3.126 +	if (!gw.valid(e.out)) {
   3.127  	  e.out_or_in=0;
   3.128 -	  graph->first(e.in, v); 
   3.129 -	  while( graph->valid(e.in) && !(free(e.in)>0) ) { graph->next(e.in); }
   3.130 +	  gw.first(e.in, v); 
   3.131 +	  while( gw.valid(e.in) && !(free(e.in)>0) ) { gw.next(e.in); }
   3.132  	}
   3.133        } else {
   3.134 -	graph->next(e.in);
   3.135 -	while( graph->valid(e.in) && !(free(e.in)>0) ) { graph->next(e.in); } 
   3.136 +	gw.next(e.in);
   3.137 +	while( gw.valid(e.in) && !(free(e.in)>0) ) { gw.next(e.in); } 
   3.138        }
   3.139        return e;
   3.140      }
   3.141  
   3.142      EdgeIt& next(EdgeIt& e) const { 
   3.143        if (e.out_or_in) {
   3.144 -	graph->next(e.out);
   3.145 -	while (graph->valid(e.out) && !(free(e.out)>0) ) { graph->next(e.out); }
   3.146 -	  while (graph->valid(e.v) && !graph->valid(e.out)) { 
   3.147 -	    graph->next(e.v); 
   3.148 -	    if (graph->valid(e.v)) graph->first(e.out, e.v); 
   3.149 -	    while (graph->valid(e.out) && !(free(e.out)>0) ) { graph->next(e.out); }
   3.150 +	gw.next(e.out);
   3.151 +	while (gw.valid(e.out) && !(free(e.out)>0) ) { gw.next(e.out); }
   3.152 +	  while (gw.valid(e.v) && !gw.valid(e.out)) { 
   3.153 +	    gw.next(e.v); 
   3.154 +	    if (gw.valid(e.v)) gw.first(e.out, e.v); 
   3.155 +	    while (gw.valid(e.out) && !(free(e.out)>0) ) { gw.next(e.out); }
   3.156  	  }
   3.157 -	  if (!graph->valid(e.out)) {
   3.158 +	  if (!gw.valid(e.out)) {
   3.159  	    e.out_or_in=0;
   3.160 -	    graph->first(e.v);
   3.161 -	    if (graph->valid(e.v)) graph->first(e.in, e.v); else e.in=OldInEdgeIt(INVALID);
   3.162 -	    while (graph->valid(e.in) && !(free(e.in)>0) ) { graph->next(e.in); }
   3.163 -	    while (graph->valid(e.v) && !graph->valid(e.in)) { 
   3.164 -	      graph->next(e.v); 
   3.165 -	      if (graph->valid(e.v)) graph->first(e.in, e.v); 
   3.166 -	      while (graph->valid(e.in) && !(free(e.in)>0) ) { graph->next(e.in); }
   3.167 +	    gw.first(e.v);
   3.168 +	    if (gw.valid(e.v)) gw.first(e.in, e.v); else e.in=/*OldInEdgeIt*/(INVALID);
   3.169 +	    while (gw.valid(e.in) && !(free(e.in)>0) ) { gw.next(e.in); }
   3.170 +	    while (gw.valid(e.v) && !gw.valid(e.in)) { 
   3.171 +	      gw.next(e.v); 
   3.172 +	      if (gw.valid(e.v)) gw.first(e.in, e.v); 
   3.173 +	      while (gw.valid(e.in) && !(free(e.in)>0) ) { gw.next(e.in); }
   3.174  	    }  
   3.175  	  }
   3.176  	} else {
   3.177 -	  graph->next(e.in);
   3.178 -	  while (graph->valid(e.in) && !(free(e.in)>0) ) { graph->next(e.in); }
   3.179 -	  while (graph->valid(e.v) && !graph->valid(e.in)) { 
   3.180 -	    graph->next(e.v); 
   3.181 -	    if (graph->valid(e.v)) graph->first(e.in, e.v); 
   3.182 -	    while (graph->valid(e.in) && !(free(e.in)>0) ) { graph->next(e.in); }
   3.183 +	  gw.next(e.in);
   3.184 +	  while (gw.valid(e.in) && !(free(e.in)>0) ) { gw.next(e.in); }
   3.185 +	  while (gw.valid(e.v) && !gw.valid(e.in)) { 
   3.186 +	    gw.next(e.v); 
   3.187 +	    if (gw.valid(e.v)) gw.first(e.in, e.v); 
   3.188 +	    while (gw.valid(e.in) && !(free(e.in)>0) ) { gw.next(e.in); }
   3.189  	  }
   3.190  	}
   3.191  	return e;
   3.192 @@ -994,20 +996,20 @@
   3.193      }
   3.194  
   3.195      Node tail(Edge e) const { 
   3.196 -      return ((e.out_or_in) ? graph->aNode(e.out) : graph->aNode(e.in)); }
   3.197 +      return ((e.out_or_in) ? gw.aNode(e.out) : gw.aNode(e.in)); }
   3.198      Node head(Edge e) const { 
   3.199 -      return ((e.out_or_in) ? graph->bNode(e.out) : graph->bNode(e.in)); }
   3.200 +      return ((e.out_or_in) ? gw.bNode(e.out) : gw.bNode(e.in)); }
   3.201  
   3.202      Node aNode(OutEdgeIt e) const { 
   3.203 -      return ((e.out_or_in) ? graph->aNode(e.out) : graph->aNode(e.in)); }
   3.204 +      return ((e.out_or_in) ? gw.aNode(e.out) : gw.aNode(e.in)); }
   3.205      Node bNode(OutEdgeIt e) const { 
   3.206 -      return ((e.out_or_in) ? graph->bNode(e.out) : graph->bNode(e.in)); }
   3.207 +      return ((e.out_or_in) ? gw.bNode(e.out) : gw.bNode(e.in)); }
   3.208  
   3.209 -    int id(Node v) const { return graph->id(v); }
   3.210 +    int id(Node v) const { return gw.id(v); }
   3.211  
   3.212 -    bool valid(Node n) const { return graph->valid(n); }
   3.213 +    bool valid(Node n) const { return gw.valid(n); }
   3.214      bool valid(Edge e) const { 
   3.215 -      return e.out_or_in ? graph->valid(e.out) : graph->valid(e.in); }
   3.216 +      return e.out_or_in ? gw.valid(e.out) : gw.valid(e.in); }
   3.217  
   3.218      void augment(const Edge& e, Number a) const {
   3.219        if (e.out_or_in)  
   3.220 @@ -1031,12 +1033,12 @@
   3.221        return (flow->get(in)); 
   3.222      }
   3.223  
   3.224 -    template<typename T> class NodeMap : public Graph::NodeMap<T> { 
   3.225 +    template<typename T> class NodeMap : public GraphWrapper::NodeMap<T> { 
   3.226      public:
   3.227        NodeMap(const ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>& _G) 
   3.228 -	: Graph::NodeMap<T>(_G.getGraph()) { }
   3.229 +	: GraphWrapper::NodeMap<T>(_G.gw) { }
   3.230        NodeMap(const ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>& _G, 
   3.231 -	      T a) : Graph::NodeMap<T>(_G.getGraph(), a) { }
   3.232 +	      T a) : GraphWrapper::NodeMap<T>(_G.gw, a) { }
   3.233      };
   3.234  
   3.235  //     template <typename T>
   3.236 @@ -1051,10 +1053,10 @@
   3.237  
   3.238      template <typename T>
   3.239      class EdgeMap {
   3.240 -      typename Graph::EdgeMap<T> forward_map, backward_map; 
   3.241 +      typename GraphWrapper::EdgeMap<T> forward_map, backward_map; 
   3.242      public:
   3.243 -      EdgeMap(const ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>& _G) : forward_map(_G.getGraph()), backward_map(_G.getGraph()) { }
   3.244 -      EdgeMap(const ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>& _G, T a) : forward_map(_G.getGraph(), a), backward_map(_G.getGraph(), a) { }
   3.245 +      EdgeMap(const ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>& _G) : forward_map(_G.gw), backward_map(_G.gw) { }
   3.246 +      EdgeMap(const ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>& _G, T a) : forward_map(_G.gw, a), backward_map(_G.gw, a) { }
   3.247        void set(Edge e, T a) { 
   3.248  	if (e.out_or_in) 
   3.249  	  forward_map.set(e.out, a); 
   3.250 @@ -1127,8 +1129,8 @@
   3.251      //  return first(i, p); }
   3.252      
   3.253      //template<typename I> I getNext(const I& i) const { 
   3.254 -    //  return graph->getNext(i); }
   3.255 -    //template<typename I> I& next(I &i) const { return graph->next(i); }    
   3.256 +    //  return gw.getNext(i); }
   3.257 +    //template<typename I> I& next(I &i) const { return gw.next(i); }    
   3.258  
   3.259      template< typename It > It first() const { 
   3.260        It e; first(e); return e; }
   3.261 @@ -1136,23 +1138,23 @@
   3.262      template< typename It > It first(const Node& v) const { 
   3.263        It e; first(e, v); return e; }
   3.264  
   3.265 -    //Node head(const Edge& e) const { return graph->head(e); }
   3.266 -    //Node tail(const Edge& e) const { return graph->tail(e); }
   3.267 +    //Node head(const Edge& e) const { return gw.head(e); }
   3.268 +    //Node tail(const Edge& e) const { return gw.tail(e); }
   3.269  
   3.270      //template<typename I> bool valid(const I& i) const 
   3.271 -    //  { return graph->valid(i); }
   3.272 +    //  { return gw.valid(i); }
   3.273    
   3.274 -    //int nodeNum() const { return graph->nodeNum(); }
   3.275 -    //int edgeNum() const { return graph->edgeNum(); }
   3.276 +    //int nodeNum() const { return gw.nodeNum(); }
   3.277 +    //int edgeNum() const { return gw.edgeNum(); }
   3.278    
   3.279      //template<typename I> Node aNode(const I& e) const { 
   3.280 -    //  return graph->aNode(e); }
   3.281 +    //  return gw.aNode(e); }
   3.282      //template<typename I> Node bNode(const I& e) const { 
   3.283 -    //  return graph->bNode(e); }
   3.284 +    //  return gw.bNode(e); }
   3.285    
   3.286 -    //Node addNode() const { return graph->addNode(); }
   3.287 +    //Node addNode() const { return gw.addNode(); }
   3.288      //Edge addEdge(const Node& tail, const Node& head) const { 
   3.289 -    //  return graph->addEdge(tail, head); }
   3.290 +    //  return gw.addEdge(tail, head); }
   3.291    
   3.292      //void erase(const OutEdgeIt& e) {
   3.293      //  first_out_edge(this->tail(e))=e;
   3.294 @@ -1162,9 +1164,9 @@
   3.295        next(f);
   3.296        first_out_edges.set(this->tail(e), f);
   3.297      }
   3.298 -    //template<typename I> void erase(const I& i) const { graph->erase(i); }
   3.299 +    //template<typename I> void erase(const I& i) const { gw.erase(i); }
   3.300    
   3.301 -    //void clear() const { graph->clear(); }
   3.302 +    //void clear() const { gw.clear(); }
   3.303      
   3.304      template<typename T> class NodeMap : public ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::NodeMap<T> { 
   3.305      public:
   3.306 @@ -1209,7 +1211,7 @@
   3.307    public:
   3.308      FilterGraphWrapper(const Graph& _G, FlowMap& _flow, 
   3.309  			   const CapacityMap& _capacity) : 
   3.310 -      ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>(_G, _flow, _capacity), dist(*this, graph->nodeNum()) { 
   3.311 +      ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>(_G, _flow, _capacity), dist(*this, gw.nodeNum()) { 
   3.312      }
   3.313  
   3.314      OutEdgeIt& first(OutEdgeIt& e, const Node& n) const {
   3.315 @@ -1248,13 +1250,13 @@
   3.316      //void setGraph(Graph& _graph) { graph = &_graph; }
   3.317      //Graph& getGraph() const { return (*graph); }
   3.318      
   3.319 -    //template<typename I> I& first(I& i) const { return graph->first(i); }
   3.320 +    //template<typename I> I& first(I& i) const { return gw.first(i); }
   3.321      //template<typename I, typename P> I& first(I& i, const P& p) const { 
   3.322 -    //  return graph->first(i, p); }
   3.323 +    //  return gw.first(i, p); }
   3.324      
   3.325      //template<typename I> I getNext(const I& i) const { 
   3.326 -    //  return graph->getNext(i); }
   3.327 -    //template<typename I> I& next(I &i) const { return graph->next(i); }    
   3.328 +    //  return gw.getNext(i); }
   3.329 +    //template<typename I> I& next(I &i) const { return gw.next(i); }    
   3.330  
   3.331      template< typename It > It first() const { 
   3.332        It e; first(e); return e; }
   3.333 @@ -1262,30 +1264,30 @@
   3.334      template< typename It > It first(const Node& v) const { 
   3.335        It e; first(e, v); return e; }
   3.336  
   3.337 -    //Node head(const Edge& e) const { return graph->head(e); }
   3.338 -    //Node tail(const Edge& e) const { return graph->tail(e); }
   3.339 +    //Node head(const Edge& e) const { return gw.head(e); }
   3.340 +    //Node tail(const Edge& e) const { return gw.tail(e); }
   3.341  
   3.342      //template<typename I> bool valid(const I& i) const 
   3.343 -    //  { return graph->valid(i); }
   3.344 +    //  { return gw.valid(i); }
   3.345    
   3.346      //template<typename I> void setInvalid(const I &i);
   3.347 -    //{ return graph->setInvalid(i); }
   3.348 +    //{ return gw.setInvalid(i); }
   3.349  
   3.350 -    //int nodeNum() const { return graph->nodeNum(); }
   3.351 -    //int edgeNum() const { return graph->edgeNum(); }
   3.352 +    //int nodeNum() const { return gw.nodeNum(); }
   3.353 +    //int edgeNum() const { return gw.edgeNum(); }
   3.354    
   3.355      //template<typename I> Node aNode(const I& e) const { 
   3.356 -    //  return graph->aNode(e); }
   3.357 +    //  return gw.aNode(e); }
   3.358      //template<typename I> Node bNode(const I& e) const { 
   3.359 -    //  return graph->bNode(e); }
   3.360 +    //  return gw.bNode(e); }
   3.361    
   3.362 -    //Node addNode() const { return graph->addNode(); }
   3.363 +    //Node addNode() const { return gw.addNode(); }
   3.364      //Edge addEdge(const Node& tail, const Node& head) const { 
   3.365 -    //  return graph->addEdge(tail, head); }
   3.366 +    //  return gw.addEdge(tail, head); }
   3.367    
   3.368 -    //template<typename I> void erase(const I& i) const { graph->erase(i); }
   3.369 +    //template<typename I> void erase(const I& i) const { gw.erase(i); }
   3.370    
   3.371 -    //void clear() const { graph->clear(); }
   3.372 +    //void clear() const { gw.clear(); }
   3.373      
   3.374      template<typename T> class NodeMap : public ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::NodeMap<T> { 
   3.375      public:
   3.376 @@ -1341,10 +1343,10 @@
   3.377  //     typedef typename Graph::SymEdgeIt SymEdgeIt;
   3.378  //     typedef typename Graph::EdgeIt EdgeIt;
   3.379  
   3.380 -//     int nodeNum() const { return graph->nodeNum(); }
   3.381 -//     int edgeNum() const { return graph->edgeNum(); }
   3.382 +//     int nodeNum() const { return gw.nodeNum(); }
   3.383 +//     int edgeNum() const { return gw.edgeNum(); }
   3.384  
   3.385 -//     Node& first(Node& n) const { return graph->first(n); }
   3.386 +//     Node& first(Node& n) const { return gw.first(n); }
   3.387  
   3.388  //     // Edge and SymEdge  is missing!!!!
   3.389  //     // Edge <-> In/OutEdgeIt conversion is missing!!!!
   3.390 @@ -1353,70 +1355,70 @@
   3.391  //     OutEdgeIt& first(OutEdgeIt& e, const Node& n) const 
   3.392  //       {
   3.393  // 	e.n=n;
   3.394 -// 	graph->first(e.o,n);
   3.395 -// 	while(graph->valid(e.o) && fmap.get(e.o)>=himap.get(e.o))
   3.396 -// 	  graph->goNext(e.o);
   3.397 -// 	if(!graph->valid(e.o)) {
   3.398 -// 	  graph->first(e.i,n);
   3.399 -// 	  while(graph->valid(e.i) && fmap.get(e.i)<=lomap.get(e.i))
   3.400 -// 	    graph->goNext(e.i);
   3.401 +// 	gw.first(e.o,n);
   3.402 +// 	while(gw.valid(e.o) && fmap.get(e.o)>=himap.get(e.o))
   3.403 +// 	  gw.goNext(e.o);
   3.404 +// 	if(!gw.valid(e.o)) {
   3.405 +// 	  gw.first(e.i,n);
   3.406 +// 	  while(gw.valid(e.i) && fmap.get(e.i)<=lomap.get(e.i))
   3.407 +// 	    gw.goNext(e.i);
   3.408  // 	}
   3.409  // 	return e;
   3.410  //       }
   3.411  // /*
   3.412  //   OutEdgeIt &goNext(OutEdgeIt &e)
   3.413  //   {
   3.414 -//   if(graph->valid(e.o)) {
   3.415 -//   while(graph->valid(e.o) && fmap.get(e.o)>=himap.get(e.o))
   3.416 -//   graph->goNext(e.o);
   3.417 -//   if(graph->valid(e.o)) return e;
   3.418 -//   else graph->first(e.i,e.n);
   3.419 +//   if(gw.valid(e.o)) {
   3.420 +//   while(gw.valid(e.o) && fmap.get(e.o)>=himap.get(e.o))
   3.421 +//   gw.goNext(e.o);
   3.422 +//   if(gw.valid(e.o)) return e;
   3.423 +//   else gw.first(e.i,e.n);
   3.424  //   }
   3.425  //   else {
   3.426 -//   while(graph->valid(e.i) && fmap.get(e.i)<=lomap.get(e.i))
   3.427 -//   graph->goNext(e.i);
   3.428 +//   while(gw.valid(e.i) && fmap.get(e.i)<=lomap.get(e.i))
   3.429 +//   gw.goNext(e.i);
   3.430  //   return e;
   3.431  //   }
   3.432  //   }
   3.433  //   OutEdgeIt Next(const OutEdgeIt &e) {OutEdgeIt t(e); return goNext(t);}
   3.434  // */
   3.435 -//     //bool valid(const OutEdgeIt e) { return graph->valid(e.o)||graph->valid(e.i);}
   3.436 +//     //bool valid(const OutEdgeIt e) { return gw.valid(e.o)||gw.valid(e.i);}
   3.437  
   3.438  //     //FIXME
   3.439  //     InEdgeIt& first(InEdgeIt& e, const Node& n) const 
   3.440  //       {
   3.441  // 	e.n=n;
   3.442 -// 	graph->first(e.i,n);
   3.443 -// 	while(graph->valid(e.i) && fmap.get(e.i)>=himap.get(e.i))
   3.444 -// 	  graph->goNext(e.i);
   3.445 -// 	if(!graph->valid(e.i)) {
   3.446 -// 	  graph->first(e.o,n);
   3.447 -// 	  while(graph->valid(e.o) && fmap.get(e.o)<=lomap.get(e.o))
   3.448 -// 	    graph->goNext(e.o);
   3.449 +// 	gw.first(e.i,n);
   3.450 +// 	while(gw.valid(e.i) && fmap.get(e.i)>=himap.get(e.i))
   3.451 +// 	  gw.goNext(e.i);
   3.452 +// 	if(!gw.valid(e.i)) {
   3.453 +// 	  gw.first(e.o,n);
   3.454 +// 	  while(gw.valid(e.o) && fmap.get(e.o)<=lomap.get(e.o))
   3.455 +// 	    gw.goNext(e.o);
   3.456  // 	}
   3.457  // 	return e;
   3.458  //       }
   3.459  // /*
   3.460  //   InEdgeIt &goNext(InEdgeIt &e)
   3.461  //   {
   3.462 -//   if(graph->valid(e.i)) {
   3.463 -//   while(graph->valid(e.i) && fmap.get(e.i)>=himap.get(e.i))
   3.464 -//   graph->goNext(e.i);
   3.465 -//   if(graph->valid(e.i)) return e;
   3.466 -//   else graph->first(e.o,e.n);
   3.467 +//   if(gw.valid(e.i)) {
   3.468 +//   while(gw.valid(e.i) && fmap.get(e.i)>=himap.get(e.i))
   3.469 +//   gw.goNext(e.i);
   3.470 +//   if(gw.valid(e.i)) return e;
   3.471 +//   else gw.first(e.o,e.n);
   3.472  //   }
   3.473  //   else {
   3.474 -//   while(graph->valid(e.o) && fmap.get(e.o)<=lomap.get(e.o))
   3.475 -//   graph->goNext(e.o);
   3.476 +//   while(gw.valid(e.o) && fmap.get(e.o)<=lomap.get(e.o))
   3.477 +//   gw.goNext(e.o);
   3.478  //   return e;
   3.479  //   }
   3.480  //   }
   3.481  //   InEdgeIt Next(const InEdgeIt &e) {InEdgeIt t(e); return goNext(t);}
   3.482  // */
   3.483 -//     //bool valid(const InEdgeIt e) { return graph->valid(e.i)||graph->valid(e.o);}
   3.484 +//     //bool valid(const InEdgeIt e) { return gw.valid(e.i)||gw.valid(e.o);}
   3.485  
   3.486 -//     //template<typename I> I &goNext(I &i); { return graph->goNext(i); }
   3.487 -//     //template<typename I> I next(const I i); { return graph->goNext(i); }
   3.488 +//     //template<typename I> I &goNext(I &i); { return gw.goNext(i); }
   3.489 +//     //template<typename I> I next(const I i); { return gw.goNext(i); }
   3.490  
   3.491  //     template< typename It > It first() const { 
   3.492  //       It e; first(e); return e; }
   3.493 @@ -1424,27 +1426,27 @@
   3.494  //     template< typename It > It first(Node v) const { 
   3.495  //       It e; first(e, v); return e; }
   3.496  
   3.497 -//     Node head(const Edge& e) const { return graph->head(e); }
   3.498 -//     Node tail(const Edge& e) const { return graph->tail(e); }
   3.499 +//     Node head(const Edge& e) const { return gw.head(e); }
   3.500 +//     Node tail(const Edge& e) const { return gw.tail(e); }
   3.501    
   3.502  //     template<typename I> Node aNode(const I& e) const { 
   3.503 -//       return graph->aNode(e); }
   3.504 +//       return gw.aNode(e); }
   3.505  //     template<typename I> Node bNode(const I& e) const { 
   3.506 -//       return graph->bNode(e); }
   3.507 +//       return gw.bNode(e); }
   3.508    
   3.509  //     //template<typename I> bool valid(const I i);
   3.510 -//     //{ return graph->valid(i); }
   3.511 +//     //{ return gw.valid(i); }
   3.512    
   3.513  //     //template<typename I> void setInvalid(const I &i);
   3.514 -//     //{ return graph->setInvalid(i); }
   3.515 +//     //{ return gw.setInvalid(i); }
   3.516    
   3.517 -//     Node addNode() { return graph->addNode(); }
   3.518 +//     Node addNode() { return gw.addNode(); }
   3.519  //     Edge addEdge(const Node& tail, const Node& head) { 
   3.520 -//       return graph->addEdge(tail, head); }
   3.521 +//       return gw.addEdge(tail, head); }
   3.522    
   3.523 -//     template<typename I> void erase(const I& i) { graph->erase(i); }
   3.524 +//     template<typename I> void erase(const I& i) { gw.erase(i); }
   3.525    
   3.526 -//     void clear() { graph->clear(); }
   3.527 +//     void clear() { gw.clear(); }
   3.528    
   3.529  //     template<typename S> class NodeMap : public Graph::NodeMap<S> { };
   3.530  //     template<typename S> class EdgeMap : public Graph::EdgeMap<S> { };
   3.531 @@ -1458,5 +1460,5 @@
   3.532  
   3.533  } //namespace hugo
   3.534  
   3.535 -#endif //GRAPH_WRAPPER_H
   3.536 +#endif //HUGO_GRAPH_WRAPPER_H
   3.537  
     4.1 --- a/src/work/marci/makefile	Mon Mar 29 11:08:59 2004 +0000
     4.2 +++ b/src/work/marci/makefile	Mon Mar 29 16:00:00 2004 +0000
     4.3 @@ -5,17 +5,19 @@
     4.4  #CXXFLAGS = -W -Wall -ansi -pedantic -I. -I.. -I../alpar
     4.5  #LEDAROOT ?= /ledasrc/LEDA-4.1
     4.6  BOOSTROOT ?= /home/marci/boost
     4.7 -INCLUDEDIRS ?= -I../../include -I.. -I. -I../{marci,jacint,alpar,klao,akos,athos} -I$(LEDAROOT)/incl -I$(BOOSTROOT)
     4.8 +INCLUDEDIRS ?= -I../../include -I.. -I../{marci,jacint,alpar,klao,akos,athos} -I$(BOOSTROOT)
     4.9 +LEDAINCLUDE ?= -I$(LEDAROOT)/incl
    4.10  CXXFLAGS = -g -O -W -Wall $(INCLUDEDIRS) -ansi -pedantic
    4.11  
    4.12 -LEDABINARIES = lg_vs_sg leda_graph_demo leda_bfs_dfs
    4.13 -BINARIES = edmonds_karp_demo max_bipartite_matching_demo
    4.14 +LEDABINARIES = lg_vs_sg leda_graph_demo leda_bfs_dfs max_bipartite_matching_demo
    4.15 +BINARIES = edmonds_karp_demo
    4.16  #preflow_demo_boost edmonds_karp_demo_boost preflow_demo_jacint preflow_demo_athos edmonds_karp_demo_alpar preflow_demo_leda
    4.17  
    4.18  all: $(BINARIES)
    4.19  
    4.20  .depend dep depend:
    4.21  	-g++ $(INCLUDEDIRS) -M $(BINARIES:=.cc) > .depend #2>/dev/null
    4.22 +#	-g++ $(INCLUDEDIRS) $(LEDAINCLUDE) -M $(LEDABINARIES:=.cc) >> .depend #2>/dev/null
    4.23  
    4.24  
    4.25  
    4.26 @@ -41,8 +43,8 @@
    4.27  	$(CXX3) -Wall -O -L$(LEDAROOT) -o leda_bfs_dfs leda_bfs_dfs.o -lG -lL -lm
    4.28  
    4.29  edmonds_karp_demo: 
    4.30 -	$(CXX3) $(CXXFLAGS) -g -I. -I.. -o edmonds_karp_demo edmonds_karp_demo.cc
    4.31 -	$(CXX3) $(CXXFLAGS) -g -pg -I. -I.. -o edmonds_karp_demo_prof edmonds_karp_demo.cc
    4.32 +	$(CXX3) $(CXXFLAGS) -o edmonds_karp_demo edmonds_karp_demo.cc
    4.33 +#	$(CXX3) $(CXXFLAGS) -pg -o edmonds_karp_demo_prof edmonds_karp_demo.cc
    4.34  
    4.35  lg_vs_sg:
    4.36  	$(CXX3) $(CXXFLAGS) -g -I. -I.. -o lg_vs_sg lg_vs_sg.cc
     5.1 --- a/src/work/marci/time_measure.h	Mon Mar 29 11:08:59 2004 +0000
     5.2 +++ b/src/work/marci/time_measure.h	Mon Mar 29 16:00:00 2004 +0000
     5.3 @@ -1,6 +1,6 @@
     5.4  // -*- c++ -*-
     5.5 -#ifndef TIME_MEASURE_H
     5.6 -#define TIME_MEASURE_H
     5.7 +#ifndef HUGO_TIME_MEASURE_H
     5.8 +#define HUGO_TIME_MEASURE_H
     5.9  
    5.10  #include <sys/time.h>
    5.11  #include <sys/times.h>
    5.12 @@ -127,4 +127,4 @@
    5.13    return os;
    5.14  }
    5.15  
    5.16 -#endif //TIME_MEASURE_H
    5.17 +#endif //HUGO_TIME_MEASURE_H