demo/lp_maxflow_demo.cc
changeset 1571 68ce4302fb0b
parent 1561 be178ff88711
child 1577 15098fb5275c
     1.1 --- a/demo/lp_maxflow_demo.cc	Wed Jul 20 08:01:16 2005 +0000
     1.2 +++ b/demo/lp_maxflow_demo.cc	Wed Jul 20 08:02:11 2005 +0000
     1.3 @@ -82,12 +82,11 @@
     1.4    }
     1.5    
     1.6    //Objective function: the flow value entering 't'
     1.7 -  {
     1.8 -    LpDefault::Expr ex;
     1.9 -    for(InEdgeIt  e(g,t);e!=INVALID;++e) ex+=x[e];
    1.10 -    for(OutEdgeIt e(g,t);e!=INVALID;++e) ex-=x[e];
    1.11 -    lp.setObj(ex);
    1.12 -  }
    1.13 +  LpDefault::Expr obj;
    1.14 +  for(InEdgeIt  e(g,t);e!=INVALID;++e) obj+=x[e];
    1.15 +  for(OutEdgeIt e(g,t);e!=INVALID;++e) obj-=x[e];
    1.16 +  lp.setObj(obj);
    1.17 +
    1.18  
    1.19    //Maximization
    1.20    lp.max();