COIN-OR::LEMON - Graph Library

Changeset 1377:bfbb5b30c5b8 in lemon-0.x for src/lemon/lp_glpk.cc


Ignore:
Timestamp:
04/20/05 17:06:42 (15 years ago)
Author:
athos
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1822
Message:

_clearObj instead of _setObj.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/lemon/lp_glpk.cc

    r1376 r1377  
    268268  }
    269269
    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//     }
    281287   
    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//   }
    286292
    287293  LpGlpk::SolveExitStatus LpGlpk::_solve()
Note: See TracChangeset for help on using the changeset viewer.