lemon/lp_cplex.cc
changeset 2282 9d7b12f83daa
parent 2168 6474b8254f24
child 2312 07e46cbb7d85
equal deleted inserted replaced
15:ff2a30852e3e 16:16ee0a49094e
   267   LpCplex::SolveExitStatus LpCplex::_solve()
   267   LpCplex::SolveExitStatus LpCplex::_solve()
   268   {
   268   {
   269     //CPX_PARAM_LPMETHOD 
   269     //CPX_PARAM_LPMETHOD 
   270     status = CPXlpopt(env, lp);
   270     status = CPXlpopt(env, lp);
   271     //status = CPXprimopt(env, lp);
   271     //status = CPXprimopt(env, lp);
   272 #if CPX_VERSION >= 900
   272 #if CPX_VERSION >= 800
   273     if (status)
   273     if (status)
   274     {
   274     {
   275       return UNSOLVED;
   275       return UNSOLVED;
   276     }
   276     }
   277     else
   277     else
   414 #endif
   414 #endif
   415   }
   415   }
   416 
   416 
   417   LpCplex::SolutionStatus LpCplex::_getPrimalStatus()
   417   LpCplex::SolutionStatus LpCplex::_getPrimalStatus()
   418   {
   418   {
       
   419     //Unboundedness not treated well: the following is from cplex 9.0 doc
       
   420     // About Unboundedness
       
   421 
       
   422     // The treatment of models that are unbounded involves a few
       
   423     // subtleties. Specifically, a declaration of unboundedness means that
       
   424     // ILOG CPLEX has determined that the model has an unbounded
       
   425     // ray. Given any feasible solution x with objective z, a multiple of
       
   426     // the unbounded ray can be added to x to give a feasible solution
       
   427     // with objective z-1 (or z+1 for maximization models). Thus, if a
       
   428     // feasible solution exists, then the optimal objective is
       
   429     // unbounded. Note that ILOG CPLEX has not necessarily concluded that
       
   430     // a feasible solution exists. Users can call the routine CPXsolninfo
       
   431     // to determine whether ILOG CPLEX has also concluded that the model
       
   432     // has a feasible solution.
       
   433 
   419     int stat = CPXgetstat(env, lp);
   434     int stat = CPXgetstat(env, lp);
   420 #if CPX_VERSION >= 900
   435 #if CPX_VERSION >= 800
   421     switch (stat)
   436     switch (stat)
   422     {
   437     {
   423       case CPX_STAT_OPTIMAL:
   438       case CPX_STAT_OPTIMAL:
   424         return OPTIMAL;
   439         return OPTIMAL;
   425       case CPX_STAT_UNBOUNDED:
   440       case CPX_STAT_UNBOUNDED:
   483 // CPX_STAT_UNBOUNDED
   498 // CPX_STAT_UNBOUNDED
   484 
   499 
   485   LpCplex::SolutionStatus LpCplex::_getDualStatus()
   500   LpCplex::SolutionStatus LpCplex::_getDualStatus()
   486   {
   501   {
   487     int stat = CPXgetstat(env, lp);
   502     int stat = CPXgetstat(env, lp);
   488 #if CPX_VERSION >= 900
   503 #if CPX_VERSION >= 800
   489     switch (stat)
   504     switch (stat)
   490     {
   505     {
   491       case CPX_STAT_OPTIMAL:
   506       case CPX_STAT_OPTIMAL:
   492         return OPTIMAL;
   507         return OPTIMAL;
   493       case CPX_STAT_UNBOUNDED:
   508       case CPX_STAT_UNBOUNDED:
   512   }
   527   }
   513 
   528 
   514   LpCplex::ProblemTypes LpCplex::_getProblemType()
   529   LpCplex::ProblemTypes LpCplex::_getProblemType()
   515   {
   530   {
   516     int stat = CPXgetstat(env, lp);
   531     int stat = CPXgetstat(env, lp);
   517 #if CPX_VERSION >= 900
   532 #if CPX_VERSION >= 800
   518     switch (stat)
   533     switch (stat)
   519     {
   534     {
   520       case CPX_STAT_OPTIMAL:
   535       case CPX_STAT_OPTIMAL:
   521 	return PRIMAL_DUAL_FEASIBLE;
   536 	return PRIMAL_DUAL_FEASIBLE;
   522       case CPX_STAT_UNBOUNDED:
   537       case CPX_STAT_UNBOUNDED: