COIN-OR::LEMON - Graph Library

Changeset 1460:7c58aabb9eea in lemon-0.x for lemon/lp_glpk.cc


Ignore:
Timestamp:
06/09/05 17:03:58 (15 years ago)
Author:
athos
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1940
Message:

I could not check, because: aclocal-1.7: command not found

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/lp_glpk.cc

    r1458 r1460  
    445445      return UNDEFINED;
    446446    case LPX_D_NOFEAS://There is no feasible solution (primal, I guess)
    447     case LPX_D_INFEAS://Infeasible
     447//    case LPX_D_INFEAS://Infeasible
    448448      return INFEASIBLE;
    449449    case LPX_FEAS://Feasible   
     
    465465  LpGlpk::ProblemTypes LpGlpk::_problemType()
    466466  {
    467     int stat=  lpx_get_status(lp);
     467      //int stat=  lpx_get_status(lp);
    468468    int statp=  lpx_get_prim_stat(lp);
    469469    int statd=  lpx_get_dual_stat(lp);
    470     switch (stat) {
    471     case LPX_UNDEF://Undefined (no solve has been run yet)
    472       return UNDEFINED;
    473       break;
    474     case LPX_NOFEAS://There is no feasible solution (primal, I guess)
    475     case LPX_INFEAS://Infeasible
    476       return INFEASIBLE;
    477       break;
    478     case LPX_UNBND://Unbounded
    479       return INFINITE;
    480       break;
    481     case LPX_FEAS://Feasible
    482       return FEASIBLE;
    483       break;
    484     case LPX_OPT://Feasible
    485       return OPTIMAL;
    486       break;
    487     default:
    488       return UNDEFINED; //to avoid gcc warning
    489       //FIXME error
    490     }
     470    if (statp==LP_P_FEAS && statd==LP_D_FEAS)
     471        return PRIMAL_DUAL_FEASIBLE;
     472    if (statp==LP_P_FEAS && statd==LP_D_NOFEAS)
     473        return PRIMAL_FEASIBLE_DUAL_INFEASIBLE;
     474    if (statp==LP_P_NOFEAS && statd==LP_D_FEAS)
     475        return PRIMAL_INFEASIBLE_DUAL_FEASIBLE;
     476    if (statp==LP_P_NOFEAS && statd==LP_D_NOFEAS)
     477        return PRIMAL_DUAL_INFEASIBLE;
     478    //In all other cases
     479    return UNKNOWN;
    491480  }
    492481
Note: See TracChangeset for help on using the changeset viewer.