COIN-OR::LEMON - Graph Library

Changeset 788:c3187cafcabf in lemon-0.x


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.

Location:
src
Files:
3 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)];
  • src/hugo/minlengthpaths.h

    r776 r788  
    1313#include <vector>
    1414#include <hugo/mincostflows.h>
    15 #include <for_each_macros.h>
    1615
    1716namespace hugo {
     
    8483      EdgeIntMap reversed(G);
    8584
    86       //FOR_EACH_LOC(typename Graph::EdgeIt, e, G){
    87       for(typename Graph::EdgeIt e=loopFirst(typename Graph::EdgeIt(), (G)); e!=INVALID; ++e){
     85      for(typename Graph::EdgeIt e(G); e!=INVALID; ++e)
    8886        reversed[e] = mincost_flow.getFlow()[e];
    89       }
    9087     
    9188      paths.clear();
  • src/test/Makefile.am

    r780 r788  
    55check_PROGRAMS = graph_test dijkstra_test bfs_test dfs_test time_measure_test \
    66        error_test xy_test \
    7         unionfind_test test_tools_pass test_tools_fail
     7        unionfind_test test_tools_pass test_tools_fail \
     8        minlengthpaths_test mincostflows_test
    89
    910TESTS = $(check_PROGRAMS)
     
    2021test_tools_pass_SOURCES = test_tools_pass.cc
    2122test_tools_fail_SOURCES = test_tools_fail.cc
     23minlengthpaths_test_SOURCES = minlengthpaths_test.cc
     24mincostflows_test_SOURCES = mincostflows_test.cc
    2225
Note: See TracChangeset for help on using the changeset viewer.