COIN-OR::LEMON - Graph Library

Changeset 1273:2b2ffa625775 in lemon-0.x for src/work/athos/lp/lp_test.cc


Ignore:
Timestamp:
03/30/05 12:38:22 (16 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1703
Message:
  • Better (but still incomplete) doc
  • lp_test runs correctly
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/athos/lp/lp_test.cc

    r1272 r1273  
    117117 
    118118  lp.addRow(LP::INF,e,23);
    119   lp.addRow(LP::INF,3.0*(p1+p2)-p3,23);
    120119  lp.addRow(LP::INF,3.0*(x[1]+x[2]/2)-x[3],23);
    121   lp.addRow(LP::INF,3.0*(p1+p2*2-5*p3+12-p4/3)+2*p4-4,23);
    122120  lp.addRow(LP::INF,3.0*(x[1]+x[2]*2-5*x[3]+12-x[4]/3)+2*x[4]-4,23);
    123121
    124122  lp.addRow(x[1]+x[3]<=x[5]-3);
    125123  lp.addRow(-7<=x[1]+x[3]-12<=3);
    126   //lp.addRow(x[1]<=x[5]);
     124  lp.addRow(x[1]<=x[5]);
    127125
    128126}
     
    144142  typename G::EdgeMap<LpGlpk::Col> x(g);
    145143  lp.addColSet(x);
    146    //for(EdgeIt e(g);e!=INVALID;++e) x[e]=lp.addCol();
    147144 
    148145  for(EdgeIt e(g);e!=INVALID;++e) {
     
    155152    for(InEdgeIt  e(g,n);e!=INVALID;++e) ex+=x[e];
    156153    for(OutEdgeIt e(g,n);e!=INVALID;++e) ex-=x[e];
    157     lp.addRow(0,ex,0);
     154    lp.addRow(ex==0);
    158155  }
    159156  {
     
    178175
    179176  ListGraph g;
     177  ListGraph::Node s=g.addNode();
     178  ListGraph::Node t=g.addNode();
     179
    180180  ListGraph::EdgeMap<double> cap(g);
    181181 
    182   maxFlow(g,cap,ListGraph::NodeIt(g),ListGraph::NodeIt(g));
     182  maxFlow(g,cap,s,t);
    183183
    184184}
Note: See TracChangeset for help on using the changeset viewer.