COIN-OR::LEMON - Graph Library

Changeset 2185:e2bf51eab7f7 in lemon-0.x


Ignore:
Timestamp:
08/30/06 18:08:03 (18 years ago)
Author:
athos
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2906
Message:

Fixed the mip error (mipstatus was incorrect).

Location:
lemon
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • lemon/lp_base.h

    r2148 r2185  
    122122      ///\e
    123123    enum SolutionStatus {
    124       ///Feasible solution has'n been found (but may exist).
     124      ///Feasible solution hasn't been found (but may exist).
    125125
    126126      ///\todo NOTFOUND might be a better name.
     
    12061206    }
    12071207
     1208    /// The status of the MIP problem
     1209    SolutionStatus mipStatus() {
     1210      return _getMipStatus();
     1211    }
     1212
    12081213  protected:
    12091214
    12101215    virtual ColTypes _colType(int col) = 0;
    12111216    virtual void _colType(int col, ColTypes col_type) = 0;
     1217    virtual SolutionStatus _getMipStatus()=0;
    12121218
    12131219  };
  • lemon/mip_glpk.cc

    r2149 r2185  
    7070    }
    7171  }
    72  
     72
     73
     74  LpGlpk::SolutionStatus MipGlpk::_getMipStatus(){
     75
     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:
     91      return UNDEFINED; //to avoid gcc warning
     92      //FIXME error
     93    }
     94  } 
     95
    7396  MipGlpk::Value MipGlpk::_getPrimal(int i){
    7497    return lpx_mip_col_val(lp,i);
  • lemon/mip_glpk.h

    r2148 r2185  
    5050   
    5151    virtual LpGlpk::SolveExitStatus _solve();
     52    virtual LpGlpk::SolutionStatus _getMipStatus();
    5253    virtual ParentLp::Value _getPrimal(int i);
    5354    virtual ParentLp::Value _getPrimalValue();
Note: See TracChangeset for help on using the changeset viewer.