Changeset 1273:2b2ffa625775 in lemon-0.x for src/work/athos/lp/lp_test.cc
- Timestamp:
- 03/30/05 12:38:22 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1703
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/athos/lp/lp_test.cc
r1272 r1273 117 117 118 118 lp.addRow(LP::INF,e,23); 119 lp.addRow(LP::INF,3.0*(p1+p2)-p3,23);120 119 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);122 120 lp.addRow(LP::INF,3.0*(x[1]+x[2]*2-5*x[3]+12-x[4]/3)+2*x[4]-4,23); 123 121 124 122 lp.addRow(x[1]+x[3]<=x[5]-3); 125 123 lp.addRow(-7<=x[1]+x[3]-12<=3); 126 //lp.addRow(x[1]<=x[5]);124 lp.addRow(x[1]<=x[5]); 127 125 128 126 } … … 144 142 typename G::EdgeMap<LpGlpk::Col> x(g); 145 143 lp.addColSet(x); 146 //for(EdgeIt e(g);e!=INVALID;++e) x[e]=lp.addCol();147 144 148 145 for(EdgeIt e(g);e!=INVALID;++e) { … … 155 152 for(InEdgeIt e(g,n);e!=INVALID;++e) ex+=x[e]; 156 153 for(OutEdgeIt e(g,n);e!=INVALID;++e) ex-=x[e]; 157 lp.addRow( 0,ex,0);154 lp.addRow(ex==0); 158 155 } 159 156 { … … 178 175 179 176 ListGraph g; 177 ListGraph::Node s=g.addNode(); 178 ListGraph::Node t=g.addNode(); 179 180 180 ListGraph::EdgeMap<double> cap(g); 181 181 182 maxFlow(g,cap, ListGraph::NodeIt(g),ListGraph::NodeIt(g));182 maxFlow(g,cap,s,t); 183 183 184 184 }
Note: See TracChangeset
for help on using the changeset viewer.