COIN-OR::LEMON - Graph Library

Changeset 389:770cc1f4861f in lemon-0.x for src/work/marci/edmonds_karp.h


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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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(
Note: See TracChangeset for help on using the changeset viewer.