COIN-OR::LEMON - Graph Library

Changeset 1458:7a483c1d38b5 in lemon-0.x for lemon/lp_glpk.cc


Ignore:
Timestamp:
06/09/05 11:49:48 (14 years ago)
Author:
athos
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1938
Message:

Not ready, but I commit it for simplicity.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/lp_glpk.cc

    r1436 r1458  
    397397  LpGlpk::SolveExitStatus LpGlpk::_solve()
    398398  {
    399     int i=  lpx_simplex(lp);
     399    int i =  lpx_simplex(lp);
    400400    switch (i) {
    401401    case LPX_E_OK:
    402402      return SOLVED;
    403       break;
    404403    default:
    405404      return UNSOLVED;
     
    421420  {
    422421    int stat=  lpx_get_status(lp);
     422    switch (stat) {
     423    case LPX_UNDEF://Undefined (no solve has been run yet)
     424      return UNDEFINED;
     425    case LPX_NOFEAS://There is no feasible solution (primal, I guess)
     426    case LPX_INFEAS://Infeasible
     427      return INFEASIBLE;
     428    case LPX_UNBND://Unbounded
     429      return INFINITE;
     430    case LPX_FEAS://Feasible
     431      return FEASIBLE;
     432    case LPX_OPT://Feasible
     433      return OPTIMAL;
     434    default:
     435      return UNDEFINED; //to avoid gcc warning
     436      //FIXME error
     437    }
     438  }
     439
     440  LpGlpk::SolutionStatus LpGlpk::_getDualStatus()
     441  {
     442    int stat=  lpx_get_dual_stat(lp);
     443    switch (stat) {
     444    case LPX_D_UNDEF://Undefined (no solve has been run yet)
     445      return UNDEFINED;
     446    case LPX_D_NOFEAS://There is no feasible solution (primal, I guess)
     447    case LPX_D_INFEAS://Infeasible
     448      return INFEASIBLE;
     449    case LPX_FEAS://Feasible   
     450      int stat2=  lpx_get_prim_stat(lp);
     451      switch (stat2){
     452      case LPX_P_NOFEAS:
     453        return INFINITE;
     454      case LPX_OPT:
     455        return OPTIMAL;
     456      default:
     457        return FEASIBLE;
     458      }
     459    default:
     460      return UNDEFINED; //to avoid gcc warning
     461      //FIXME error
     462    }
     463  }
     464
     465  LpGlpk::ProblemTypes LpGlpk::_problemType()
     466  {
     467    int stat=  lpx_get_status(lp);
     468    int statp=  lpx_get_prim_stat(lp);
     469    int statd=  lpx_get_dual_stat(lp);
    423470    switch (stat) {
    424471    case LPX_UNDEF://Undefined (no solve has been run yet)
     
    444491  }
    445492
    446 
    447493  void LpGlpk::_setMax()
    448494  {
Note: See TracChangeset for help on using the changeset viewer.