Changeset 1377:bfbb5b30c5b8 in lemon0.x
 Timestamp:
 04/20/05 17:06:42 (18 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@1822
 Location:
 src/lemon
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

src/lemon/lp_base.h
r1376 r1377 435 435 virtual void _setRowUpperBound(int i, Value value) = 0; 436 436 virtual void _setObjCoeff(int i, Value obj_coef) = 0; 437 virtual void _setObj(int length, 438 int const * indices, 439 Value const * values ) = 0; 437 virtual void _clearObj()=0; 438 // virtual void _setObj(int length, 439 // int const * indices, 440 // Value const * values ) = 0; 440 441 virtual SolveExitStatus _solve() = 0; 441 442 virtual Value _getPrimal(int i) = 0; … … 450 451 Value obj_const_comp; 451 452 452 ///\e 453 454 ///\bug Unimplemented 455 void clearObj() {} 453 454 456 455 457 456 public: … … 668 667 ///\bug The previous objective function is not cleared! 669 668 void setObj(Expr e) { 670 clearObj();669 _clearObj(); 671 670 for (Expr::iterator i=e.begin(); i!=e.end(); ++i) 672 671 objCoeff((*i).first,(*i).second); 
src/lemon/lp_glpk.cc
r1376 r1377 268 268 } 269 269 270 void LpGlpk::_setObj(int length, 271 int const * indices, 272 Value const * values ) 273 { 274 Value new_values[1+lpx_num_cols()]; 275 for (i=0;i<=lpx_num_cols();++i){ 276 new_values[i]=0; 277 } 278 for (i=1;i<=length;++i){ 279 new_values[indices[i]]=values[i]; 280 } 270 void LpGlpk::_clearObj() 271 { 272 for (int i=0;i<=lpx_get_num_cols(lp);++i){ 273 lpx_set_obj_coef(lp, i, 0); 274 } 275 } 276 // void LpGlpk::_setObj(int length, 277 // int const * indices, 278 // Value const * values ) 279 // { 280 // Value new_values[1+lpx_num_cols()]; 281 // for (i=0;i<=lpx_num_cols();++i){ 282 // new_values[i]=0; 283 // } 284 // for (i=1;i<=length;++i){ 285 // new_values[indices[i]]=values[i]; 286 // } 281 287 282 for (i=0;i<=lpx_num_cols();++i){283 lpx_set_obj_coef(lp, i, new_values[i]);284 }285 }288 // for (i=0;i<=lpx_num_cols();++i){ 289 // lpx_set_obj_coef(lp, i, new_values[i]); 290 // } 291 // } 286 292 287 293 LpGlpk::SolveExitStatus LpGlpk::_solve() 
src/lemon/lp_glpk.h
r1376 r1377 64 64 virtual void _setRowUpperBound(int i, Value value); 65 65 virtual void _setObjCoeff(int i, Value obj_coef); 66 virtual void _setObj(int length, 67 int const * indices, 68 Value const * values ) = 0; 66 virtual void _clearObj(); 67 // virtual void _setObj(int length, 68 // int const * indices, 69 // Value const * values ) = 0; 69 70 70 71 ///\e
Note: See TracChangeset
for help on using the changeset viewer.