COIN-OR::LEMON - Graph Library

Changeset 389:770cc1f4861f in lemon-0.x


Ignore:
Timestamp:
04/24/04 14:44:41 (20 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@520
Message:

modifications for better compatibility with gcc 3.4.0

Location:
src
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • src/include/invalid.h

    r253 r389  
    2828  const Invalid INVALID = Invalid();
    2929
    30 };
     30} //namespace hugo
    3131
    3232#endif
  • src/include/maps.h

    r346 r389  
    9393   
    9494    template<typename T1, typename Comp1>
    95     StdMap(const StdMap<Key,T1,Comp1> &m, const T &_v) { FIXME; }
     95    StdMap(const StdMap<Key,T1,Comp1> &m, const T &_v) {
     96      //FIXME;
     97    }
    9698
    9799    ReferenceType operator[](const Key &k) {
     
    99101    }
    100102    ConstReferenceType operator[](const Key &k) const {
    101       typename parent::iterator i = lower_bound(__k);
     103//marci jav      typename parent::iterator i = lower_bound(__k);
     104      typename parent::iterator i = lower_bound(k);
    102105      if (i == end() || key_comp()(k, (*i).first))
    103106        return v;
  • src/work/jacint/preflow.h

    r372 r389  
    5353
    5454  template <typename Graph, typename T,
    55             typename CapMap=typename Graph::EdgeMap<T>,
    56             typename FlowMap=typename Graph::EdgeMap<T> >
     55            typename CapMap=typename Graph::template EdgeMap<T>,
     56            typename FlowMap=typename Graph::template EdgeMap<T> >
    5757  class Preflow {
    5858   
     
    100100      int b=k;    //bound on the highest level under n of an active node
    101101     
    102       typename Graph::NodeMap<int> level(G,n);     
    103       typename Graph::NodeMap<T> excess(G);
     102      typename Graph::template NodeMap<int> level(G,n);     
     103      typename Graph::template NodeMap<T> excess(G);
    104104
    105105      std::vector<Node> active(n-1,INVALID);
    106       typename Graph::NodeMap<Node> next(G,INVALID);
     106      typename Graph::template NodeMap<Node> next(G,INVALID);
    107107      //Stack of the active nodes in level i < n.
    108108      //We use it in both phases.
    109109
    110       typename Graph::NodeMap<Node> left(G,INVALID);
    111       typename Graph::NodeMap<Node> right(G,INVALID);
     110      typename Graph::template NodeMap<Node> left(G,INVALID);
     111      typename Graph::template NodeMap<Node> right(G,INVALID);
    112112      std::vector<Node> level_list(n,INVALID);
    113113      /*
  • src/work/list_graph.h

    r368 r389  
    3030    template <typename T> class NodeMap;
    3131    template <typename T> class EdgeMap;
    32   private:
     32//  private:
    3333    template <typename T> friend class NodeMap;
    3434    template <typename T> friend class EdgeMap;
     
    7676    };
    7777
     78  private:
    7879    int node_id;
    7980    int edge_id;
  • src/work/makefile

    r347 r389  
    11INCLUDEDIRS ?= -I../include -I. -I./{marci,jacint,alpar,klao,akos}
    2 CXXFLAGS = -g -O -Wall $(INCLUDEDIRS) -ansi -pedantic
     2CXXFLAGS = -g -O2 -W -Wall $(INCLUDEDIRS) -ansi -pedantic
    33
    44BINARIES ?= bin_heap_demo
     
    66# Hat, ez elismerem, hogy nagyon ronda, de mukodik minden altalam
    77# ismert rendszeren :-)  (Misi)
     8#CXX := $(shell type -p g++-3.4 || type -p g++-3.3 || type -p g++-3.2 || type -p g++-3.0 || type -p g++-3 || echo g++)
    89CXX := $(shell type -p g++-3.3 || type -p g++-3.2 || type -p g++-3.0 || type -p g++-3 || echo g++)
    910CC := $(CXX)
  • src/work/marci/bfs_iterator.h

    r360 r389  
    147147    bool isANodeExamined() const { return !(graph->valid(actual_edge)); }
    148148    Node aNode() const { return actual_node; /*FIXME*/}
    149     Node bNode() const { return G.bNode(actual_edge); }
     149    Node bNode() const { return graph->bNode(actual_edge); }
    150150    const ReachedMap& getReachedMap() const { return reached; }
    151151    const std::stack<OutEdgeIt>& getDfsStack() const { return dfs_stack; }
  • src/work/marci/bfsit_vs_byhand.cc

    r360 r389  
    44
    55#include <list_graph.h>
    6 #include <smart_graph.h>
     6//#include <smart_graph.h>
    77#include <dimacs.h>
    88#include <time_measure.h>
  • src/work/marci/bipartite_graph_wrapper_test.cc

    r379 r389  
    55
    66#include <list_graph.h>
    7 #include <smart_graph.h>
     7//#include <smart_graph.h>
    88//#include <dimacs.h>
    99#include <time_measure.h>
  • src/work/marci/edmonds_karp.h

    r360 r389  
    276276      bool _augment=false;
    277277     
    278       BfsIterator< ResGW, typename ResGW::NodeMap<bool> > bfs(res_graph);
     278      BfsIterator< ResGW, typename ResGW::template NodeMap<bool> >
     279        bfs(res_graph);
    279280      bfs.pushAndSetReached(s);
    280281       
    281       typename ResGW::NodeMap<ResGWEdge> pred(res_graph);
     282      typename ResGW::template NodeMap<ResGWEdge> pred(res_graph);
    282283      pred.set(s, INVALID);
    283284     
    284       typename ResGW::NodeMap<Number> free(res_graph);
     285      typename ResGW::template NodeMap<Number> free(res_graph);
    285286       
    286287      //searching for augmenting path
     
    319320    protected:
    320321      const MapGraphWrapper* g;
    321       typename MapGraphWrapper::NodeMap<int> dist;
     322      typename MapGraphWrapper::template NodeMap<int> dist;
    322323    public:
    323324      DistanceMap(MapGraphWrapper& _g) : g(&_g), dist(*g, g->nodeNum()) { }
     
    340341      ResGW res_graph(*g, *capacity, *flow);
    341342
    342       BfsIterator< ResGW, typename ResGW::NodeMap<bool> > bfs(res_graph);
     343      BfsIterator< ResGW, typename ResGW::template NodeMap<bool> >
     344        bfs(res_graph);
    343345
    344346      bfs.pushAndSetReached(s);
     
    358360        DistanceMap<ResGW> > FilterResGW;
    359361      FilterResGW filter_res_graph(res_graph, true_map, dist);
    360       typename ResGW::NodeMap<typename MG::Node> res_graph_to_F(res_graph);
     362      typename ResGW::template NodeMap<typename MG::Node>
     363        res_graph_to_F(res_graph);
    361364      {
    362365        typename ResGW::NodeIt n;
     
    368371      typename MG::Node sF=res_graph_to_F[s];
    369372      typename MG::Node tF=res_graph_to_F[t];
    370       typename MG::EdgeMap<ResGWEdge> original_edge(F);
    371       typename MG::EdgeMap<Number> residual_capacity(F);
     373      typename MG::template EdgeMap<ResGWEdge> original_edge(F);
     374      typename MG::template EdgeMap<Number> residual_capacity(F);
    372375
    373376      //Making F to the graph containing the edges of the residual graph
     
    392395        //computing blocking flow with dfs
    393396
    394         DfsIterator< MG, typename MG::NodeMap<bool> > dfs(F);
    395         typename MG::NodeMap<typename MG::Edge> pred(F);
     397        DfsIterator< MG, typename MG::template NodeMap<bool> > dfs(F);
     398        typename MG::template NodeMap<typename MG::Edge> pred(F);
    396399        pred.set(sF, INVALID);
    397400        //invalid iterators for sources
    398401
    399         typename MG::NodeMap<Number> free(F);
     402        typename MG::template NodeMap<Number> free(F);
    400403
    401404        dfs.pushAndSetReached(sF);     
     
    450453
    451454      //bfs for distances on the residual graph
    452       BfsIterator< ResGW, typename ResGW::NodeMap<bool> > bfs(res_graph);
     455      BfsIterator< ResGW, typename ResGW::template NodeMap<bool> >
     456        bfs(res_graph);
    453457      bfs.pushAndSetReached(s);
    454       typename ResGW::NodeMap<int> dist(res_graph); //filled up with 0's
     458      typename ResGW::template NodeMap<int>
     459        dist(res_graph); //filled up with 0's
    455460
    456461      //F will contain the physical copy of the residual graph
    457462      //with the set of edges which are on shortest paths
    458463      MG F;
    459       typename ResGW::NodeMap<typename MG::Node> res_graph_to_F(res_graph);
     464      typename ResGW::template NodeMap<typename MG::Node>
     465        res_graph_to_F(res_graph);
    460466      {
    461467        typename ResGW::NodeIt n;
     
    467473      typename MG::Node sF=res_graph_to_F[s];
    468474      typename MG::Node tF=res_graph_to_F[t];
    469       typename MG::EdgeMap<ResGWEdge> original_edge(F);
    470       typename MG::EdgeMap<Number> residual_capacity(F);
     475      typename MG::template EdgeMap<ResGWEdge> original_edge(F);
     476      typename MG::template EdgeMap<Number> residual_capacity(F);
    471477
    472478      while ( !bfs.finished() ) {
     
    498504        __augment=false;
    499505        //computing blocking flow with dfs
    500         DfsIterator< MG, typename MG::NodeMap<bool> > dfs(F);
    501         typename MG::NodeMap<typename MG::Edge> pred(F);
     506        DfsIterator< MG, typename MG::template NodeMap<bool> > dfs(F);
     507        typename MG::template NodeMap<typename MG::Edge> pred(F);
    502508        pred.set(sF, INVALID);
    503509        //invalid iterators for sources
    504510
    505         typename MG::NodeMap<Number> free(F);
     511        typename MG::template NodeMap<Number> free(F);
    506512
    507513        dfs.pushAndSetReached(sF);     
     
    554560      ResGW res_graph(*g, *capacity, *flow);
    555561
    556       BfsIterator< ResGW, typename ResGW::NodeMap<bool> > bfs(res_graph);
     562      BfsIterator< ResGW, typename ResGW::template NodeMap<bool> >
     563        bfs(res_graph);
    557564
    558565      bfs.pushAndSetReached(s);
     
    574581      //Subgraph, which is able to delete edges which are already
    575582      //met by the dfs
    576       typename FilterResGW::NodeMap<typename FilterResGW::OutEdgeIt>
     583      typename FilterResGW::template NodeMap<typename FilterResGW::OutEdgeIt>
    577584        first_out_edges(filter_res_graph);
    578585      typename FilterResGW::NodeIt v;
     
    585592      }
    586593      typedef ErasingFirstGraphWrapper<FilterResGW, typename FilterResGW::
    587         NodeMap<typename FilterResGW::OutEdgeIt> > ErasingResGW;
     594        template NodeMap<typename FilterResGW::OutEdgeIt> > ErasingResGW;
    588595      ErasingResGW erasing_res_graph(filter_res_graph, first_out_edges);
    589596
     
    594601        __augment=false;
    595602        //computing blocking flow with dfs
    596         DfsIterator< ErasingResGW, typename ErasingResGW::NodeMap<bool> >
     603        DfsIterator< ErasingResGW,
     604          typename ErasingResGW::template NodeMap<bool> >
    597605          dfs(erasing_res_graph);
    598         typename ErasingResGW::NodeMap<typename ErasingResGW::OutEdgeIt>
    599           pred(erasing_res_graph);
     606        typename ErasingResGW::
     607          template NodeMap<typename ErasingResGW::OutEdgeIt>
     608          pred(erasing_res_graph);
    600609        pred.set(s, INVALID);
    601610        //invalid iterators for sources
    602611
    603         typename ErasingResGW::NodeMap<Number> free1(erasing_res_graph);
     612        typename ErasingResGW::template NodeMap<Number>
     613          free1(erasing_res_graph);
    604614
    605615        dfs.pushAndSetReached(
  • src/work/marci/edmonds_karp_demo.cc

    r376 r389  
    44
    55#include <list_graph.h>
    6 #include <smart_graph.h>
     6//#include <smart_graph.h>
    77#include <dimacs.h>
    88#include <edmonds_karp.h>
  • src/work/marci/graph_wrapper.h

    r381 r389  
    184184    void clear() const { graph->clear(); }
    185185   
    186     template<typename T> class NodeMap : public Graph::NodeMap<T> {
    187     public:
    188       NodeMap(const GraphWrapper<Graph>& _G) : 
    189         Graph::NodeMap<T>(*(_G.graph)) { }
    190       NodeMap(const GraphWrapper<Graph>& _G, T a) :
    191         Graph::NodeMap<T>(*(_G.graph), a) { }
    192     };
    193 
    194     template<typename T> class EdgeMap : public Graph::EdgeMap<T> {
    195     public:
    196       EdgeMap(const GraphWrapper<Graph>& _G) : 
    197         Graph::EdgeMap<T>(*(_G.graph)) { }
    198       EdgeMap(const GraphWrapper<Graph>& _G, T a) :
    199         Graph::EdgeMap<T>(*(_G.graph), a) { }
     186    template<typename T> class NodeMap : public Graph::template NodeMap<T> {
     187      typedef typename Graph::template NodeMap<T> Parent;
     188    public:
     189      NodeMap(const GraphWrapper<Graph>& _G) :  Parent(*(_G.graph)) { }
     190      NodeMap(const GraphWrapper<Graph>& _G, T a) : Parent(*(_G.graph), a) { }
     191    };
     192
     193    template<typename T> class EdgeMap : public Graph::template EdgeMap<T> {
     194      typedef typename Graph::template EdgeMap<T> Parent;
     195    public:
     196      EdgeMap(const GraphWrapper<Graph>& _G) : Parent(*(_G.graph)) { }
     197      EdgeMap(const GraphWrapper<Graph>& _G, T a) : Parent(*(_G.graph), a) { }
    200198    };
    201199  };
     
    253251
    254252    using GraphWrapper<Graph>::next;
    255     OutEdgeIt& next(OutEdgeIt& i) const { graph->next(i.e); return i; }
    256     InEdgeIt& next(InEdgeIt& i) const { graph->next(i.e); return i; }
    257 
    258     Node aNode(const OutEdgeIt& e) const { return Node(graph->aNode(e.e)); }
    259     Node aNode(const InEdgeIt& e) const { return Node(graph->aNode(e.e)); }
    260     Node bNode(const OutEdgeIt& e) const { return Node(graph->bNode(e.e)); }
    261     Node bNode(const InEdgeIt& e) const { return Node(graph->bNode(e.e)); }
     253    OutEdgeIt& next(OutEdgeIt& i) const { this->graph->next(i.e); return i; }
     254    InEdgeIt& next(InEdgeIt& i) const { this->graph->next(i.e); return i; }
     255
     256    Node aNode(const OutEdgeIt& e) const {
     257      return Node(this->graph->aNode(e.e)); }
     258    Node aNode(const InEdgeIt& e) const {
     259      return Node(this->graph->aNode(e.e)); }
     260    Node bNode(const OutEdgeIt& e) const {
     261      return Node(this->graph->bNode(e.e)); }
     262    Node bNode(const InEdgeIt& e) const {
     263      return Node(this->graph->bNode(e.e)); }
    262264
    263265    Node tail(const Edge& e) const {
     
    367369   
    368370    NodeIt& next(NodeIt& i) const {
    369       graph->next(i.n);
    370       while (graph->valid(i) && !(*node_filter_map)[i.n]) { graph->next(i.n); }
     371      this->graph->next(i.n);
     372      while (this->graph->valid(i) && !(*node_filter_map)[i.n]) {
     373        this->graph->next(i.n); }
    371374      return i;
    372375    }
    373376    OutEdgeIt& next(OutEdgeIt& i) const {
    374       graph->next(i.e);
    375       while (graph->valid(i) && !(*edge_filter_map)[i.e]) { graph->next(i.e); }
     377      this->graph->next(i.e);
     378      while (this->graph->valid(i) && !(*edge_filter_map)[i.e]) {
     379        this->graph->next(i.e); }
    376380      return i;
    377381    }
    378382    InEdgeIt& next(InEdgeIt& i) const {
    379       graph->next(i.e);
    380       while (graph->valid(i) && !(*edge_filter_map)[i.e]) { graph->next(i.e); }
     383      this->graph->next(i.e);
     384      while (this->graph->valid(i) && !(*edge_filter_map)[i.e]) {
     385        this->graph->next(i.e); }
    381386      return i;
    382387    }
    383388    EdgeIt& next(EdgeIt& i) const {
    384       graph->next(i.e);
    385       while (graph->valid(i) && !(*edge_filter_map)[i.e]) { graph->next(i.e); }
     389      this->graph->next(i.e);
     390      while (this->graph->valid(i) && !(*edge_filter_map)[i.e]) {
     391        this->graph->next(i.e); }
    386392      return i;
    387393    }
    388394
    389     Node aNode(const OutEdgeIt& e) const { return Node(graph->aNode(e.e)); }
    390     Node aNode(const InEdgeIt& e) const { return Node(graph->aNode(e.e)); }
    391     Node bNode(const OutEdgeIt& e) const { return Node(graph->bNode(e.e)); }
    392     Node bNode(const InEdgeIt& e) const { return Node(graph->bNode(e.e)); }
     395    Node aNode(const OutEdgeIt& e) const {
     396      return Node(this->graph->aNode(e.e)); }
     397    Node aNode(const InEdgeIt& e) const {
     398      return Node(this->graph->aNode(e.e)); }
     399    Node bNode(const OutEdgeIt& e) const {
     400      return Node(this->graph->bNode(e.e)); }
     401    Node bNode(const InEdgeIt& e) const {
     402      return Node(this->graph->bNode(e.e)); }
    393403
    394404    ///\todo
     
    470480    OutEdgeIt& next(OutEdgeIt& e) const {
    471481      if (e.out_or_in) {
    472         typename Graph::Node n=graph->tail(e.out);
    473         graph->next(e.out);
    474         if (!graph->valid(e.out)) { e.out_or_in=false; graph->first(e.in, n); }
     482        typename Graph::Node n=this->graph->tail(e.out);
     483        this->graph->next(e.out);
     484        if (!this->graph->valid(e.out)) {
     485          e.out_or_in=false; this->graph->first(e.in, n); }
    475486      } else {
    476         graph->next(e.in);
     487        this->graph->next(e.in);
    477488      }
    478489      return e;
     
    486497
    487498    Node aNode(const OutEdgeIt& e) const {
    488       if (e.out_or_in) return graph->tail(e); else return graph->head(e); }
     499      if (e.out_or_in) return this->graph->tail(e); else
     500        return this->graph->head(e); }
    489501    Node bNode(const OutEdgeIt& e) const {
    490       if (e.out_or_in) return graph->head(e); else return graph->tail(e); }
     502      if (e.out_or_in) return this->graph->head(e); else
     503        return this->graph->tail(e); }
    491504  };
    492505 
     
    646659    OutEdgeIt& next(OutEdgeIt& e) const {
    647660      if (e.forward) {
    648         Node v=graph->aNode(e.out);
    649         graph->next(e.out);
    650         while( graph->valid(e.out) && !(resCap(e)>0) ) { graph->next(e.out); }
    651         if (!graph->valid(e.out)) {
     661        Node v=this->graph->aNode(e.out);
     662        this->graph->next(e.out);
     663        while( this->graph->valid(e.out) && !(resCap(e)>0) ) {
     664          this->graph->next(e.out); }
     665        if (!this->graph->valid(e.out)) {
    652666          e.forward=false;
    653           graph->first(e.in, v);
    654           while( graph->valid(e.in) && !(resCap(e)>0) ) { graph->next(e.in); }
     667          this->graph->first(e.in, v);
     668          while( this->graph->valid(e.in) && !(resCap(e)>0) ) {
     669            this->graph->next(e.in); }
    655670        }
    656671      } else {
    657         graph->next(e.in);
    658         while( graph->valid(e.in) && !(resCap(e)>0) ) { graph->next(e.in); }
     672        this->graph->next(e.in);
     673        while( this->graph->valid(e.in) && !(resCap(e)>0) ) {
     674          this->graph->next(e.in); }
    659675      }
    660676      return e;
     
    663679    InEdgeIt& next(InEdgeIt& e) const {
    664680      if (e.forward) {
    665         Node v=graph->aNode(e.in);
    666         graph->next(e.in);
    667         while( graph->valid(e.in) && !(resCap(e)>0) ) { graph->next(e.in); }
    668         if (!graph->valid(e.in)) {
     681        Node v=this->graph->aNode(e.in);
     682        this->graph->next(e.in);
     683        while( this->graph->valid(e.in) && !(resCap(e)>0) ) {
     684          this->graph->next(e.in); }
     685        if (!this->graph->valid(e.in)) {
    669686          e.forward=false;
    670           graph->first(e.out, v);
    671           while( graph->valid(e.out) && !(resCap(e)>0) ) { graph->next(e.out); }
     687          this->graph->first(e.out, v);
     688          while( this->graph->valid(e.out) && !(resCap(e)>0) ) {
     689            this->graph->next(e.out); }
    672690        }
    673691      } else {
    674         graph->next(e.out);
    675         while( graph->valid(e.out) && !(resCap(e)>0) ) { graph->next(e.out); }
     692        this->graph->next(e.out);
     693        while( this->graph->valid(e.out) && !(resCap(e)>0) ) {
     694          this->graph->next(e.out); }
    676695      }
    677696      return e;
     
    679698    EdgeIt& next(EdgeIt& e) const {
    680699      if (e.forward) {
    681         graph->next(e.e);
    682         while( graph->valid(e.e) && !(resCap(e)>0) ) { graph->next(e.e); }
    683         if (!graph->valid(e.e)) {
     700        this->graph->next(e.e);
     701        while( this->graph->valid(e.e) && !(resCap(e)>0) ) {
     702          this->graph->next(e.e); }
     703        if (!this->graph->valid(e.e)) {
    684704          e.forward=false;
    685           graph->first(e.e);
    686           while( graph->valid(e.e) && !(resCap(e)>0) ) { graph->next(e.e); }
     705          this->graph->first(e.e);
     706          while( this->graph->valid(e.e) && !(resCap(e)>0) ) {
     707            this->graph->next(e.e); }
    687708        }
    688709      } else {
    689         graph->next(e.e);
    690         while( graph->valid(e.e) && !(resCap(e)>0) ) { graph->next(e.e); }
     710        this->graph->next(e.e);
     711        while( this->graph->valid(e.e) && !(resCap(e)>0) ) {
     712          this->graph->next(e.e); }
    691713      }
    692714      return e;
     
    694716
    695717    Node tail(Edge e) const {
    696       return ((e.forward) ? graph->tail(e) : graph->head(e)); }
     718      return ((e.forward) ? this->graph->tail(e) : this->graph->head(e)); }
    697719    Node head(Edge e) const {
    698       return ((e.forward) ? graph->head(e) : graph->tail(e)); }
     720      return ((e.forward) ? this->graph->head(e) : this->graph->tail(e)); }
    699721
    700722    Node aNode(OutEdgeIt e) const {
    701       return ((e.forward) ? graph->aNode(e.out) : graph->aNode(e.in)); }
     723      return ((e.forward) ? this->graph->aNode(e.out) :
     724              this->graph->aNode(e.in)); }
    702725    Node bNode(OutEdgeIt e) const {
    703       return ((e.forward) ? graph->bNode(e.out) : graph->bNode(e.in)); }
     726      return ((e.forward) ? this->graph->bNode(e.out) :
     727              this->graph->bNode(e.in)); }
    704728
    705729    Node aNode(InEdgeIt e) const {
    706       return ((e.forward) ? graph->aNode(e.in) : graph->aNode(e.out)); }
     730      return ((e.forward) ? this->graph->aNode(e.in) :
     731              this->graph->aNode(e.out)); }
    707732    Node bNode(InEdgeIt e) const {
    708       return ((e.forward) ? graph->bNode(e.in) : graph->bNode(e.out)); }
     733      return ((e.forward) ? this->graph->bNode(e.in) :
     734              this->graph->bNode(e.out)); }
    709735
    710736//    int nodeNum() const { return graph->nodeNum(); }
     
    718744    bool valid(Node n) const { return GraphWrapper<Graph>::valid(n); }
    719745    bool valid(Edge e) const {
    720       return graph->valid(e);
     746      return this->graph->valid(e);
    721747        //return e.forward ? graph->valid(e.out) : graph->valid(e.in);
    722748    }
     
    752778    template <typename T>
    753779    class EdgeMap {
    754       typename Graph::EdgeMap<T> forward_map, backward_map;
     780      typename Graph::template EdgeMap<T> forward_map, backward_map;
    755781    public:
    756782      EdgeMap(const ResGraphWrapper<Graph, Number, CapacityMap, FlowMap>& _G) : forward_map(*(_G.graph)), backward_map(*(_G.graph)) { }
     
    862888    using GraphWrapper<Graph>::next;
    863889//    NodeIt& next(NodeIt& i) const { graph->next(i.n); return i; }
    864     OutEdgeIt& next(OutEdgeIt& i) const { graph->next(i.e); return i; }
    865     InEdgeIt& next(InEdgeIt& i) const { graph->next(i.e); return i; }
    866     EdgeIt& next(EdgeIt& i) const { graph->next(i.e); return i; }   
     890    OutEdgeIt& next(OutEdgeIt& i) const { this->graph->next(i.e); return i; }
     891    InEdgeIt& next(InEdgeIt& i) const { this->graph->next(i.e); return i; }
     892    EdgeIt& next(EdgeIt& i) const { this->graph->next(i.e); return i; }   
    867893   
    868     Node aNode(const OutEdgeIt& e) const { return Node(graph->aNode(e.e)); }
    869     Node aNode(const InEdgeIt& e) const { return Node(graph->aNode(e.e)); }
    870     Node bNode(const OutEdgeIt& e) const { return Node(graph->bNode(e.e)); }
    871     Node bNode(const InEdgeIt& e) const { return Node(graph->bNode(e.e)); }
     894    Node aNode(const OutEdgeIt& e) const {
     895      return Node(this->graph->aNode(e.e)); }
     896    Node aNode(const InEdgeIt& e) const {
     897      return Node(this->graph->aNode(e.e)); }
     898    Node bNode(const OutEdgeIt& e) const {
     899      return Node(this->graph->bNode(e.e)); }
     900    Node bNode(const InEdgeIt& e) const {
     901      return Node(this->graph->bNode(e.e)); }
    872902
    873903    void erase(const OutEdgeIt& e) const {
     
    886916  template<typename Graph>
    887917  class BipartiteGraphWrapper : public GraphWrapper<Graph> {
    888     typedef IterableBoolMap< typename Graph::NodeMap<int> > SFalseTTrueMap;
     918    typedef IterableBoolMap< typename Graph::template NodeMap<int> >
     919    SFalseTTrueMap;
    889920    SFalseTTrueMap* s_false_t_true_map;
    890921   
     
    9841015//       this->s_false_t_true_map->next(n); return n;
    9851016//     }
    986     OutEdgeIt& next(OutEdgeIt& i) const { graph->next(i.e); return i; }
    987     InEdgeIt& next(InEdgeIt& i) const { graph->next(i.e); return i; }
     1017    OutEdgeIt& next(OutEdgeIt& i) const { this->graph->next(i.e); return i; }
     1018    InEdgeIt& next(InEdgeIt& i) const { this->graph->next(i.e); return i; }
    9881019
    9891020    Node tail(const Edge& e) {
     
    10791110      friend class GraphWrapper<Graph>;
    10801111      friend class stGraphWrapper<Graph>;
    1081       template <typename T> friend class stGraphWrapper<Graph>::NodeMap;
     1112      template <typename T> friend class NodeMap;
    10821113      friend class Edge;
    10831114      friend class OutEdgeIt;
     
    11201151      friend class GraphWrapper<Graph>;
    11211152      friend class stGraphWrapper<Graph>;
    1122       template <typename T> friend class stGraphWrapper<Graph>::EdgeMap;
     1153      template <typename T> friend class EdgeMap;
    11231154      int spec;
    11241155      typename Graph::Node n;
     
    12741305      switch (i.spec) {
    12751306        case 0:
    1276           graph->next(i.n);
    1277           if (!graph->valid(i.n)) {
     1307          this->graph->next(i.n);
     1308          if (!this->graph->valid(i.n)) {
    12781309            i.spec=1;
    12791310          }
     
    12911322      switch (i.spec) {
    12921323        case 0: //normal edge
    1293           typename Graph::Node v=graph->aNode(i.e);
    1294           graph->next(i.e);
    1295           if (!graph->valid(i.e)) { //Az igazi elek vegere ertunk
    1296             if (graph->inSClass(v)) { //S, nincs kiel
     1324          typename Graph::Node v=this->graph->aNode(i.e);
     1325          this->graph->next(i.e);
     1326          if (!this->graph->valid(i.e)) { //Az igazi elek vegere ertunk
     1327            if (this->graph->inSClass(v)) { //S, nincs kiel
    12971328              i.spec=3;
    12981329              i.n=INVALID;
     
    13041335          break;
    13051336        case 1: //s->vmi
    1306           graph->next(i.n);
    1307           if (!graph->valid(i.n)) i.spec=3;
     1337          this->graph->next(i.n);
     1338          if (!this->graph->valid(i.n)) i.spec=3;
    13081339          break;
    13091340        case 2: //vmi->t
     
    13171348      switch (i.spec) {
    13181349        case 0: //normal edge
    1319           typename Graph::Node v=graph->aNode(i.e);
    1320           graph->next(i.e);
    1321           if (!graph->valid(i.e)) { //Az igazi elek vegere ertunk
    1322             if (graph->inTClass(v)) { //S, nincs beel
     1350          typename Graph::Node v=this->graph->aNode(i.e);
     1351          this->graph->next(i.e);
     1352          if (!this->graph->valid(i.e)) { //Az igazi elek vegere ertunk
     1353            if (this->graph->inTClass(v)) { //S, nincs beel
    13231354              i.spec=3;
    13241355              i.n=INVALID;
     
    13341365          break;
    13351366        case 2: //vmi->t
    1336           graph->next(i.n);
    1337           if (!graph->valid(i.n)) i.spec=3;
     1367          this->graph->next(i.n);
     1368          if (!this->graph->valid(i.n)) i.spec=3;
    13381369          break;
    13391370      }
     
    13441375      switch (i.spec) {
    13451376        case 0:
    1346           graph->next(i.e);
    1347           if (!graph->valid(i.e)) {
     1377          this->graph->next(i.e);
     1378          if (!this->graph->valid(i.e)) {
    13481379            i.spec=1;
    1349             graph->first(n, S_CLASS);
    1350             if (!graph->valid(i.n)) {
     1380            this->graph->first(i.n, S_CLASS);
     1381            if (!this->graph->valid(i.n)) {
    13511382              i.spec=2;
    1352               graph->first(n, T_CLASS);
    1353               if (!graph->valid(i.n)) spec=3;
     1383              this->graph->first(i.n, T_CLASS);
     1384              if (!this->graph->valid(i.n)) i.spec=3;
    13541385            }
    13551386          }
    13561387          break;
    13571388        case 1:
    1358           graph->next(i.n);
    1359           if (!graph->valid(i.n)) {
     1389          this->graph->next(i.n);
     1390          if (!this->graph->valid(i.n)) {
    13601391            i.spec=2;
    1361             graph->first(n, T_CLASS);
    1362             if (!graph->valid(i.n)) spec=3;
     1392            this->graph->first(i.n, T_CLASS);
     1393            if (!this->graph->valid(i.n)) i.spec=3;
    13631394          }
    13641395          break;
    13651396        case 2:
    1366           graph->next(i.n);
    1367           if (!graph->valid(i.n)) i.spec=3;
     1397          this->graph->next(i.n);
     1398          if (!this->graph->valid(i.n)) i.spec=3;
    13681399          break;
    13691400      }
     
    13741405      switch (e.spec) {
    13751406        case 0:
    1376           return Node(graph->tail(e));
     1407          return Node(this->graph->tail(e));
    13771408          break;
    13781409        case 1:
     
    13871418      switch (e.spec) {
    13881419        case 0:
    1389           return Node(graph->head(e));
     1420          return Node(this->graph->head(e));
    13901421          break;
    13911422        case 1:
     
    14011432    bool valid(const Edge& e) const { return (e.spec<3); }
    14021433
    1403 //    int nodeNum() const { return graph->nodeNum(); }
    1404 //    int edgeNum() const { return graph->edgeNum(); }
     1434//    int nodeNum() const { return this->graph->nodeNum(); }
     1435//    int edgeNum() const { return this->graph->edgeNum(); }
    14051436 
    14061437    Node aNode(const OutEdgeIt& e) const { return tail(e); }
     
    14091440    Node bNode(const InEdgeIt& e) const { return tail(e); }
    14101441 
    1411 //    Node addNode() const { return Node(graph->addNode()); }
     1442//    Node addNode() const { return Node(this->graph->addNode()); }
    14121443//    Edge addEdge(const Node& tail, const Node& head) const {
    1413 //      return Edge(graph->addEdge(tail, head)); }
    1414 
    1415 //    void erase(const Node& i) const { graph->erase(i); }
    1416 //    void erase(const Edge& i) const { graph->erase(i); }
     1444//      return Edge(this->graph->addEdge(tail, head)); }
     1445
     1446//    void erase(const Node& i) const { this->graph->erase(i); }
     1447//    void erase(const Edge& i) const { this->graph->erase(i); }
    14171448 
    1418 //    void clear() const { graph->clear(); }
     1449//    void clear() const { this->graph->clear(); }
    14191450   
    1420     template<typename T> class NodeMap : public GraphWrapper<Graph>::NodeMap<T> {
     1451    template<typename T> class NodeMap : public GraphWrapper<Graph>::template NodeMap<T> {
     1452      typedef typename GraphWrapper<Graph>::template NodeMap<T> Parent;
    14211453      T s_value, t_value;
    14221454    public:
    1423       NodeMap(const stGraphWrapper<Graph>& _G) : 
    1424         GraphWrapper<Graph>::NodeMap<T>(_G) { }
    1425       NodeMap(const stGraphWrapper<Graph>& _G, T a) :
    1426         GraphWrapper<Graph>::NodeMap<T>(_G, a), s_value(a), t_value(a) { }
     1455      NodeMap(const stGraphWrapper<Graph>& _G) :  Parent(_G) { }
     1456      NodeMap(const stGraphWrapper<Graph>& _G, T a) : Parent(_G, a),
     1457                                                      s_value(a),
     1458                                                      t_value(a) { }
    14271459      T operator[](const Node& n) const {
    14281460        switch (n.spec) {
     
    14411473        switch (n.spec) {
    14421474          case 0:
    1443             GraphWrapper<Graph>::NodeMap<T>::set(n, t);
     1475            GraphWrapper<Graph>::template NodeMap<T>::set(n, t);
    14441476            break;
    14451477          case 1:
     
    14531485    };
    14541486
    1455     template<typename T> class EdgeMap : public GraphWrapper<Graph>::EdgeMap<T> {
    1456       typename GraphWrapper<Graph>::NodeMap<T> node_value;
    1457     public:
    1458       EdgeMap(const stGraphWrapper<Graph>& _G) : 
    1459         GraphWrapper<Graph>::EdgeMap<T>(_G), node_value(_G) { }
    1460       EdgeMap(const stGraphWrapper<Graph>& _G, T a) :
    1461         GraphWrapper<Graph>::EdgeMap<T>(_G, a), node_value(_G, a) { }
     1487    template<typename T> class EdgeMap : public GraphWrapper<Graph>::template EdgeMap<T> {
     1488      typedef typename Graph::template NodeMap<T> Parent;
     1489      typename GraphWrapper<Graph>::template NodeMap<T> node_value;
     1490    public:
     1491      EdgeMap(const stGraphWrapper<Graph>& _G) :  Parent(_G),
     1492                                                  node_value(_G) { }
     1493      EdgeMap(const stGraphWrapper<Graph>& _G, T a) : Parent(_G, a),
     1494                                                      node_value(_G, a) { }
    14621495      T operator[](const Edge& e) const {
    14631496        switch (e.spec) {
  • src/work/marci/iterator_bfs_demo.cc

    r360 r389  
    55
    66#include <list_graph.h>
    7 #include <smart_graph.h>
     7//#include <smart_graph.h>
    88#include <bfs_iterator.h>
    99#include <graph_wrapper.h>
  • src/work/marci/makefile

    r380 r389  
    11CXX2 = g++-2.95
    2 CXX3 := $(shell type -p g++-3.3 || type -p g++-3.2 || type -p g++-3.0 || type -p g++-3 || echo g++)
    3 CXX=$(CXX3)
    4 CC=$(CXX)
     2#CXX3 := $(shell type -p g++-3.3 || type -p g++-3.2 || type -p g++-3.0 || type -p g++-3 || echo g++)
     3#CXX=$(CXX3)
     4#CC=$(CXX)
    55#LEDAROOT ?= /ledasrc/LEDA-4.1
    66BOOSTROOT ?= /home/marci/boost
     
    1313#gw_vs_not preflow_demo_boost edmonds_karp_demo_boost preflow_demo_jacint preflow_demo_athos edmonds_karp_demo_alpar preflow_demo_leda
    1414
    15 all: $(BINARIES)
     15include ../makefile
     16#all: $(BINARIES)
    1617
    17 .depend dep depend:
    18         -$(CXX) $(INCLUDEDIRS) -M $(BINARIES:=.cc) > .depend #2>/dev/null
     18#.depend dep depend:
     19#       -$(CXX) $(INCLUDEDIRS) -M $(BINARIES:=.cc) > .depend #2>/dev/null
    1920#       -g++ $(INCLUDEDIRS) $(LEDAINCLUDE) -M $(LEDABINARIES:=.cc) >> .depend #2>/dev/null
    2021
    2122
    2223
    23 makefile: .depend
    24 sinclude .depend
     24#makefile: .depend
     25#sinclude .depend
    2526
    2627leda_graph_demo.o:
     
    7374        $(CXX3) $(CXXFLAGS) -I. -I.. -I../athos -o preflow_demo_athos preflow_demo_athos.cc
    7475
    75 clean:
    76         $(RM) *.o $(BINARIES) .depend
    77 
    78 .PHONY: all clean dep depend
     76#clean:
     77#       $(RM) *.o $(BINARIES) .depend
     78#
     79#.PHONY: all clean dep depend
Note: See TracChangeset for help on using the changeset viewer.