COIN-OR::LEMON - Graph Library

Changeset 842:a4bb28813570 in lemon-0.x


Ignore:
Timestamp:
09/13/04 19:20:03 (20 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1141
Message:

Fix a DANGEROUS bug.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/test/preflow_test.cc

    r833 r842  
    5858  typedef SmartGraph Graph;
    5959 
     60  typedef Graph::Node Node;
    6061  typedef Graph::NodeIt NodeIt;
    6162  typedef Graph::EdgeIt EdgeIt;
     
    6970 
    7071  Graph G;
    71   NodeIt s, t;
     72  Node s, t;
    7273  CapMap cap(G);
    7374  readDimacs(file, G, cap, s, t);
     
    101102  for(EdgeIt e(G); e!=INVALID; ++e) cap[e]=2*cap[e];
    102103  preflow_test.setCap(cap); 
    103   preflow_test.setTarget(++t); //the max flow value remains 2*flow_value
     104
     105  NodeIt tmp_node(G,t);
     106  ++tmp_node;
     107  t=tmp_node;
     108 
     109  preflow_test.setTarget(t); //the max flow value remains 2*flow_value
    104110  //warning: ++t must be a valid node. In preflow_graph, it is.
    105111
Note: See TracChangeset for help on using the changeset viewer.