lemon/mip_glpk.cc
changeset 2504 46a82ce84cc6
parent 2442 27b7c7de9cac
child 2553 bfced05fa852
equal deleted inserted replaced
11:c99769cec7c3 12:524efcd9e460
    73   
    73   
    74   LpGlpk::SolveExitStatus MipGlpk::_solve() {
    74   LpGlpk::SolveExitStatus MipGlpk::_solve() {
    75     int result = LEMON_lpx(simplex)(lp);
    75     int result = LEMON_lpx(simplex)(lp);
    76 
    76 
    77     // hack: mip does not contain integer variable 
    77     // hack: mip does not contain integer variable 
    78 #if GLP_MAJOR_VERSION > 4 || (GLP_MAJOR_VERSION == 4 && GLP_MINOR_VERSION > 15)
    78 #if GLP_MAJOR_VERSION == 4 && GLP_MINOR_VERSION == 16
    79     int tmp = -1;
    79     int tmp = -1;
    80     if (LEMON_glp(get_num_int(lp)) == 0) {
    80     if (LEMON_glp(get_num_int(lp)) == 0) {
    81       tmp = LEMON_lpx(add_cols)(lp, 1);
    81       tmp = LEMON_lpx(add_cols)(lp, 1);
    82       LEMON_glp(set_col_bnds)(lp, tmp, LEMON_GLP(FX), 0.0, 0.0);
    82       LEMON_glp(set_col_bnds)(lp, tmp, LEMON_GLP(FX), 0.0, 0.0);
    83       LEMON_glp(set_col_kind)(lp, tmp, LEMON_GLP(IV));
    83       LEMON_glp(set_col_kind)(lp, tmp, LEMON_GLP(IV));
    97 	solved = false;
    97 	solved = false;
    98       }  
    98       }  
    99     } else {
    99     } else {
   100       solved = false;
   100       solved = false;
   101     }
   101     }
   102 #if GLP_MAJOR_VERSION > 4 || (GLP_MAJOR_VERSION == 4 && GLP_MINOR_VERSION > 15)
   102 #if GLP_MAJOR_VERSION == 4 && GLP_MINOR_VERSION == 16
   103     if (tmp != -1) {
   103     if (tmp != -1) {
   104       int tmpa[2];
   104       int tmpa[2];
   105       tmpa[1] = tmp;
   105       tmpa[1] = tmp;
   106       LEMON_lpx(del_cols)(lp, 1, tmpa);
   106       LEMON_lpx(del_cols)(lp, 1, tmpa);
   107     }
   107     }