COIN-OR::LEMON - Graph Library

Changeset 1460:7c58aabb9eea in lemon-0.x


Ignore:
Timestamp:
06/09/05 17:03:58 (20 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

Location:
lemon
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • lemon/lp_base.h

    r1458 r1460  
    119119    };
    120120     
    121     ///\e
     121      ///\e
    122122    enum SolutionStatus {
    123123      ///Feasible solution has'n been found (but may exist).
     
    138138      INFINITE = 4
    139139    };
     140
     141      ///\e The type of the investigated LP problem
     142      enum Problemtypes {
     143          ///Primal-dual feasible
     144          PRIMAL_DUAL_FEASIBLE = 0,
     145          ///Primal feasible dual infeasible
     146          PRIMAL_FEASIBLE_DUAL_INFEASIBLE = 1,
     147          ///Primal infeasible dual feasible
     148          PRIMAL_INFEASIBLE_DUAL_FEASIBLE = 2,
     149          ///Primal-dual infeasible
     150          PRIMAL_DUAL_INFEASIBLE = 3,
     151          ///Could not determine so far
     152          UNKNOWN = 4
     153      };
    140154     
    141155    ///The floating point type used by the solver
     
    564578    virtual Value _getPrimalValue() = 0;
    565579    virtual SolutionStatus _getPrimalStatus() = 0;
     580    virtual SolutionStatus _getDualStatus() = 0;
     581    ///\todo This could be implemented here, too, using _getPrimalStatus() and
     582    ///_getDualStatus()
     583    virtual ProblemTypes _getProblemType() = 0;
     584
    566585    virtual void _setMax() = 0;
    567586    virtual void _setMin() = 0;
     
    931950    ///@{
    932951
    933     ///\e
     952    /// The status of the primal problem (the original LP problem)
    934953    SolutionStatus primalStatus() {
    935954      return _getPrimalStatus();
     955    }
     956
     957    /// The status of the dual (of the original LP) problem
     958    SolutionStatus dualStatus() {
     959      return _getDualStatus();
     960    }
     961
     962    ///The type of the original LP problem
     963    Problemtypes problemType() {
     964      return _getProblemType();
    936965    }
    937966
  • lemon/lp_cplex.cc

    r1458 r1460  
    261261  }
    262262
     263  LpCplex::Value LpCplex::_getPrimal(int i)
     264  {
     265    Value x;
     266    CPXgetx (env, lp, &x, i, i);
     267    return x;
     268  }
     269 
     270  LpCplex::Value LpCplex::_getPrimalValue()
     271  {
     272    Value objval;
     273    //method = CPXgetmethod (env, lp);
     274    status = CPXgetobjval (env, lp, &objval);
     275    return objval;
     276  }
     277 
    263278
    264279//7.5-os cplex statusai (Vigyazat: a 9.0-asei masok!)
     
    378393    }
    379394
    380   LpCplex::Value LpCplex::_getPrimal(int i)
    381   {
    382     Value x;
    383     CPXgetx (env, lp, &x, i, i);
    384     return x;
    385   }
    386  
    387   LpCplex::Value LpCplex::_getPrimalValue()
    388   {
    389     Value objval;
    390     //method = CPXgetmethod (env, lp);
    391     status = CPXgetobjval (env, lp, &objval);
    392     return objval;
    393   }
    394  
    395395 
     396  LpCplex::ProblemTypes LpCplex::_getProblemType()
     397  {
     398    int stat = CPXgetstat (env, lp);
     399    switch (stat) {
     400    case CPX_OPTIMAL://Optimal
     401        return PRIMAL_DUAL_FEASIBLE;
     402    case CPX_UNBOUNDED:
     403        return PRIMAL_FEASIBLE_DUAL_INFEASIBLE;
     404//      return PRIMAL_INFEASIBLE_DUAL_FEASIBLE;
     405//      return PRIMAL_DUAL_INFEASIBLE;
     406
     407//Seems to be that this is all we can say for sure
     408    default:
     409        //In all other cases
     410        return UNKNOWN;
     411      //FIXME error
     412    }
    396413
    397414
  • lemon/lp_cplex.h

    r1435 r1460  
    7676    ///\e
    7777   
    78     ///\bug Unimplemented
    79     ///
    8078    virtual SolveExitStatus _solve();
    81     ///\e
    8279
    83     ///\bug Unimplemented
    84     ///
    8580    virtual Value _getPrimal(int i);
    86     ///\e
     81
    8782   
    88     ///\bug Unimplemented
    89     ///
    9083    virtual Value _getPrimalValue();
    91     ///\e
    9284   
    93     ///\bug Unimplemented
    94     ///
    9585    virtual SolutionStatus _getPrimalStatus();
     86    virtual SolutionStatus _getDualStatus();
     87    virtual ProblemTypes _getProblemType();
    9688
    97     ///\e
    9889   
    99     ///\bug Unimplemented
    100     ///
    10190    virtual void _setMax();
    102     ///\e
    103    
    104     ///\bug Unimplemented
    105     ///
    10691    virtual void _setMin();
    10792
  • 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
  • lemon/lp_glpk.h

    r1435 r1460  
    8686    ///
    8787    virtual SolutionStatus _getPrimalStatus();
     88    virtual SolutionStatus _getDualStatus();
     89    virtual ProblemTypes _getProblemType();
     90
    8891    virtual void _setMax();
    8992    virtual void _setMin();
  • lemon/lp_skeleton.cc

    r1435 r1460  
    121121  LpSkeleton::SolutionStatus LpSkeleton::_getPrimalStatus()
    122122  {
    123     return OPTIMAL;
     123    return UNDEFINED;
     124  }
     125
     126  LpSkeleton::SolutionStatus LpSkeleton::_getDualStatus()
     127  {
     128    return UNDEFINED;
     129  }
     130
     131  LpSkeleton::ProblemTypes LpSkeleton::_getProblemType()
     132  {
     133    return UNKNOWN;
    124134  }
    125135 
  • lemon/lp_skeleton.h

    r1435 r1460  
    119119    virtual SolutionStatus _getPrimalStatus();
    120120
     121    ////e
     122    virtual SolutionStatus _getDualStatus();
     123
     124
     125    ///\e
     126    virtual ProblemTypes _getProblemType();
     127
    121128    ///\e
    122129    virtual void _setMax();
Note: See TracChangeset for help on using the changeset viewer.