Changeset 1258:88dff8bb4bf2 in lemon-0.x for src/work/athos/lp
- Timestamp:
- 03/25/05 12:03:49 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1685
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/athos/lp/lp_base.h
r1256 r1258 260 260 #endif 261 261 ///Add a new empty row (i.e a new constaint) to the LP 262 263 ///This function adds a new empty row (i.e a new constaint) to the LP. 264 ///\return The created row 262 265 Row addRow() { Row r; r.id=rows.insert(_addRow()); return r;} 263 266 264 ///Add a new row (i.e a new constaint) to the LP 265 266 ///\param l lower bound (-INF means no bound) 267 ///\param e a linear expression (see \ref Expr) 268 ///\param u upper bound (INF means no bound) 267 ///Set a row (i.e a constaint) of the LP 268 269 ///\param r is the row to be modified 270 ///\param l is lower bound (-INF means no bound) 271 ///\param e is a linear expression (see \ref Expr) 272 ///\param u is the upper bound (INF means no bound) 269 273 ///\bug This is a temportary function. The interface will change to 270 274 ///a better one. 271 Row addRow(Value l,Expr e, Value u) { 272 Row r=addRow(); 275 void setRow(Row r, Value l,const Expr &e, Value u) { 273 276 std::vector<int> indices; 274 277 std::vector<Value> values; 275 278 indices.push_back(0); 276 279 values.push_back(0); 277 for(Expr:: iterator i=e.begin(); i!=e.end(); ++i)280 for(Expr::const_iterator i=e.begin(); i!=e.end(); ++i) 278 281 if((*i).second!=0) { ///\bug EPSILON would be necessary here!!! 279 282 indices.push_back(cols.floatingId((*i).first.id)); … … 284 287 _setRowLowerBound(rows.floatingId(r.id),l-e.constComp()); 285 288 _setRowUpperBound(rows.floatingId(r.id),u-e.constComp()); 289 } 290 291 ///Add a new row (i.e a new constaint) to the LP 292 293 ///\param l is the lower bound (-INF means no bound) 294 ///\param e is a linear expression (see \ref Expr) 295 ///\param u is the upper bound (INF means no bound) 296 ///\return The created row. 297 ///\bug This is a temportary function. The interface will change to 298 ///a better one. 299 Row addRow(Value l,const Expr &e, Value u) { 300 Row r=addRow(); 301 setRow(r,l,e,u); 286 302 return r; 287 303 }
Note: See TracChangeset
for help on using the changeset viewer.