COIN-OR::LEMON - Graph Library

Changeset 2213:2c094dfa176d in lemon-0.x for lemon


Ignore:
Timestamp:
09/08/06 17:51:32 (13 years ago)
Author:
athos
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2941
Message:

Some corrections.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/mip_glpk.cc

    r2185 r2213  
    5858  LpGlpk::SolveExitStatus MipGlpk::_solve(){
    5959    int result = lpx_simplex(lp);
    60     result = lpx_integer(lp);
    61     switch (result){
    62       case LPX_E_OBJLL:
    63       case LPX_E_OBJUL:
    64       case LPX_E_ITLIM:
    65       case LPX_E_TMLIM:
     60    //
     61    if (lpx_get_status(lp)==LPX_OPT){
     62      //Maybe we could try the routine lpx_intopt(lp), a revised
     63      //version of lpx_integer
     64      result = lpx_integer(lp);
     65      switch (result){
    6666      case LPX_E_OK:
    67         return SOLVED;
     67        return SOLVED;
    6868      default:
    69         return UNSOLVED;
     69        return UNSOLVED;
     70      }
     71     
    7072    }
     73    return UNSOLVED;
    7174  }
    7275
     
    7477  LpGlpk::SolutionStatus MipGlpk::_getMipStatus(){
    7578
    76     //Meg kell nezni: ha az LP is infinite, akkor ez is, ha az is
    77     //infeasible, akkor ez is, de ez lehet maskepp is infeasible.
    78     int stat=  lpx_mip_status(lp);
    79     switch (stat) {
    80     case LPX_I_UNDEF://Undefined (no solve has been run yet)
    81       return UNDEFINED;
    82    case LPX_I_NOFEAS://There is no feasible integral solution (primal, I guess)
    83       return INFEASIBLE;
    84 //     case LPX_UNBND://Unbounded
    85 //       return INFINITE;
    86     case LPX_I_FEAS://Feasible
    87       return FEASIBLE;
    88     case LPX_I_OPT://Feasible
    89       return OPTIMAL;
    90     default:
     79    if (lpx_get_status(lp)==LPX_OPT){
     80      //Meg kell nezni: ha az LP is infinite, akkor ez is, ha az is
     81      //infeasible, akkor ez is, de ez lehet maskepp is infeasible.
     82      int stat=  lpx_mip_status(lp);
     83     
     84      switch (stat) {
     85      case LPX_I_UNDEF://Undefined (no solve has been run yet)
     86        return UNDEFINED;
     87      case LPX_I_NOFEAS://There is no feasible integral solution
     88        return INFEASIBLE;
     89        //     case LPX_UNBND://Unbounded
     90        //       return INFINITE;
     91      case LPX_I_FEAS://Feasible
     92        return FEASIBLE;
     93      case LPX_I_OPT://Feasible
     94        return OPTIMAL;
     95      default:
    9196      return UNDEFINED; //to avoid gcc warning
    9297      //FIXME error
     98      }
    9399    }
     100    else
     101      return UNDEFINED; //Maybe we could refine this: what does the LP
     102                        //relaxation look like
     103     
    94104  } 
    95105
Note: See TracChangeset for help on using the changeset viewer.