lemon/mip_glpk.cc
changeset 2185 e2bf51eab7f7
parent 2149 b437bdee6fd0
child 2213 2c094dfa176d
     1.1 --- a/lemon/mip_glpk.cc	Mon Aug 28 16:11:02 2006 +0000
     1.2 +++ b/lemon/mip_glpk.cc	Wed Aug 30 16:08:03 2006 +0000
     1.3 @@ -69,7 +69,30 @@
     1.4          return UNSOLVED;
     1.5      }
     1.6    }
     1.7 -  
     1.8 +
     1.9 +
    1.10 +  LpGlpk::SolutionStatus MipGlpk::_getMipStatus(){
    1.11 +
    1.12 +    //Meg kell nezni: ha az LP is infinite, akkor ez is, ha az is
    1.13 +    //infeasible, akkor ez is, de ez lehet maskepp is infeasible.
    1.14 +    int stat=  lpx_mip_status(lp);
    1.15 +    switch (stat) {
    1.16 +    case LPX_I_UNDEF://Undefined (no solve has been run yet)
    1.17 +      return UNDEFINED;
    1.18 +   case LPX_I_NOFEAS://There is no feasible integral solution (primal, I guess)
    1.19 +      return INFEASIBLE;
    1.20 +//     case LPX_UNBND://Unbounded
    1.21 +//       return INFINITE;
    1.22 +    case LPX_I_FEAS://Feasible
    1.23 +      return FEASIBLE;
    1.24 +    case LPX_I_OPT://Feasible
    1.25 +      return OPTIMAL;
    1.26 +    default:
    1.27 +      return UNDEFINED; //to avoid gcc warning
    1.28 +      //FIXME error
    1.29 +    }
    1.30 +  }  
    1.31 +
    1.32    MipGlpk::Value MipGlpk::_getPrimal(int i){
    1.33      return lpx_mip_col_val(lp,i);
    1.34    }