COIN-OR::LEMON - Graph Library

Changeset 788:c3187cafcabf in lemon-0.x for src/hugo/mincostflows.h


Ignore:
Timestamp:
09/02/04 18:56:33 (15 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1081
Message:

mincostflow_test is ok.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/hugo/mincostflows.h

    r785 r788  
    1212#include <hugo/maps.h>
    1313#include <vector>
    14 #include <hugo/for_each_macros.h>
    1514
    1615namespace hugo {
     
    117116      total_length = 0;
    118117     
    119       for(typename Graph::EdgeIt e=loopFirst(typename Graph::EdgeIt(), (G)); e!=INVALID; ++e){
    120         flow.set(e,0);
    121       }
     118      for (typename Graph::EdgeIt e(G); e!=INVALID; ++e) flow.set(e, 0);
    122119
    123120      //Initialize the potential to zero
    124       for(typename Graph::NodeIt n=loopFirst(typename Graph::NodeIt(), (G)); n!=INVALID; ++n){
    125         potential.set(n,0);
    126       }
    127      
    128 
     121      for (typename Graph::NodeIt n(G); n!=INVALID; ++n) potential.set(n, 0);
     122     
    129123     
    130124      //We need a residual graph
     
    145139       
    146140        //We have to change the potential
    147         //#define FOR_EACH_LOC(Ittype, e, g) for(Ittype e=loopFirst(Ittype(), (g)); (g).valid(e); (g).next(e))
    148         //FOR_EACH_LOC(typename ResGraphType::NodeIt, n, res_graph){
    149         for(typename ResGraphType::NodeIt n=loopFirst(typename ResGraphType::NodeIt(), (res_graph)); n!=INVALID; ++n){
     141        for(typename ResGraphType::NodeIt n(res_graph); n!=INVALID; ++n)
    150142          potential[n] += dijkstra.distMap()[n];
    151         }
    152143
    153144
     
    198189      Length mod_pot;
    199190      Length fl_e;
    200         //#define FOR_EACH_LOC(Ittype, e, g) for(Ittype e=loopFirst(Ittype(), (g)); (g).valid(e); (g).next(e))
    201         //FOR_EACH_LOC(typename Graph::EdgeIt, e, G){
    202         for(typename Graph::EdgeIt e=loopFirst(typename Graph::EdgeIt(), (G)); e!=INVALID; ++e){
     191        for(typename Graph::EdgeIt e(G); e!=INVALID; ++e) {
    203192        //C^{\Pi}_{i,j}
    204193        mod_pot = length[e]-potential[G.head(e)]+potential[G.tail(e)];
Note: See TracChangeset for help on using the changeset viewer.