Changeset 1376:8de0c1aeeb32 in lemon0.x
 Timestamp:
 04/20/05 16:29:23 (15 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@1821
 Location:
 src/lemon
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

src/lemon/lp_base.h
r1364 r1376 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 440 virtual SolveExitStatus _solve() = 0; 438 441 virtual Value _getPrimal(int i) = 0; 
src/lemon/lp_glpk.cc
r1368 r1376 264 264 void LpGlpk::_setObjCoeff(int i, Value obj_coef) 265 265 { 266 //i=0 means the constant term (shift) 266 267 lpx_set_obj_coef(lp, i, obj_coef); 267 268 } 268 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 } 281 282 for (i=0;i<=lpx_num_cols();++i){ 283 lpx_set_obj_coef(lp, i, new_values[i]); 284 } 285 } 269 286 270 287 LpGlpk::SolveExitStatus LpGlpk::_solve() 
src/lemon/lp_glpk.h
r1364 r1376 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; 69 66 70 ///\e 67 71
Note: See TracChangeset
for help on using the changeset viewer.