src/lemon/lp_glpk.cc
changeset 1377 bfbb5b30c5b8
parent 1376 8de0c1aeeb32
child 1379 96a34c0904dd
equal deleted inserted replaced
8:f790d705d59d 9:0628c58b0426
   265   {
   265   {
   266     //i=0 means the constant term (shift)
   266     //i=0 means the constant term (shift)
   267     lpx_set_obj_coef(lp, i, obj_coef);
   267     lpx_set_obj_coef(lp, i, obj_coef);
   268   }
   268   }
   269 
   269 
   270   void LpGlpk::_setObj(int length,
   270   void LpGlpk::_clearObj()
   271 		       int  const * indices, 
   271   {
   272 		       Value  const * values )
   272     for (int i=0;i<=lpx_get_num_cols(lp);++i){
   273   {
   273       lpx_set_obj_coef(lp, i, 0);
   274     Value new_values[1+lpx_num_cols()];
   274     }
   275     for (i=0;i<=lpx_num_cols();++i){
   275   }
   276       new_values[i]=0;
   276 //   void LpGlpk::_setObj(int length,
   277     }
   277 // 		       int  const * indices, 
   278     for (i=1;i<=length;++i){
   278 // 		       Value  const * values )
   279       new_values[indices[i]]=values[i];
   279 //   {
   280     }
   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){
   288 //     for (i=0;i<=lpx_num_cols();++i){
   283       lpx_set_obj_coef(lp, i, new_values[i]);
   289 //       lpx_set_obj_coef(lp, i, new_values[i]);
   284     }
   290 //     }
   285   }
   291 //   }
   286 
   292 
   287   LpGlpk::SolveExitStatus LpGlpk::_solve()
   293   LpGlpk::SolveExitStatus LpGlpk::_solve()
   288   {
   294   {
   289     int i=  lpx_simplex(lp);
   295     int i=  lpx_simplex(lp);
   290     switch (i) {
   296     switch (i) {