Cplex works.
1.1 --- a/src/lemon/lp_cplex.cc Thu May 05 15:47:45 2005 +0000
1.2 +++ b/src/lemon/lp_cplex.cc Fri May 06 15:39:33 2005 +0000
1.3 @@ -261,6 +261,70 @@
1.4
1.5 LpCplex::SolutionStatus LpCplex::_getPrimalStatus()
1.6 {
1.7 +//7.5-os cplex statusai
1.8 +// #define CPX_OPTIMAL 1
1.9 +// #define CPX_INFEASIBLE 2
1.10 +// #define CPX_UNBOUNDED 3
1.11 +// #define CPX_OBJ_LIM 4
1.12 +// #define CPX_IT_LIM_FEAS 5
1.13 +// #define CPX_IT_LIM_INFEAS 6
1.14 +// #define CPX_TIME_LIM_FEAS 7
1.15 +// #define CPX_TIME_LIM_INFEAS 8
1.16 +// #define CPX_NUM_BEST_FEAS 9
1.17 +// #define CPX_NUM_BEST_INFEAS 10
1.18 +// #define CPX_OPTIMAL_INFEAS 11
1.19 +// #define CPX_ABORT_FEAS 12
1.20 +// #define CPX_ABORT_INFEAS 13
1.21 +// #define CPX_ABORT_DUAL_INFEAS 14
1.22 +// #define CPX_ABORT_PRIM_INFEAS 15
1.23 +// #define CPX_ABORT_PRIM_DUAL_INFEAS 16
1.24 +// #define CPX_ABORT_PRIM_DUAL_FEAS 17
1.25 +// #define CPX_ABORT_CROSSOVER 18
1.26 +// #define CPX_INForUNBD 19
1.27 +// #define CPX_PIVOT 20
1.28 +
1.29 +// Ezeket hova tegyem:
1.30 +// ??case CPX_ABORT_DUAL_INFEAS
1.31 +// ??case CPX_ABORT_CROSSOVER
1.32 +// ??case CPX_INForUNBD
1.33 +// ??case CPX_PIVOT
1.34 +
1.35 + int stat = CPXgetstat (env, lp);
1.36 + switch (stat) {
1.37 + case 0:
1.38 + return UNDEFINED; //Undefined
1.39 + break;
1.40 + case CPX_OPTIMAL://Optimal
1.41 + return OPTIMAL;
1.42 + break;
1.43 + case CPX_UNBOUNDED://Unbounded
1.44 + return INFINITE;
1.45 + break;
1.46 + case CPX_INFEASIBLE://Infeasible
1.47 + case CPX_IT_LIM_INFEAS:
1.48 + case CPX_TIME_LIM_INFEAS:
1.49 + case CPX_NUM_BEST_INFEAS:
1.50 + case CPX_OPTIMAL_INFEAS:
1.51 + case CPX_ABORT_INFEAS:
1.52 + case CPX_ABORT_PRIM_INFEAS:
1.53 + case CPX_ABORT_PRIM_DUAL_INFEAS:
1.54 + return INFEASIBLE;
1.55 + break;
1.56 + case CPX_OBJ_LIM:
1.57 + case CPX_IT_LIM_FEAS:
1.58 + case CPX_TIME_LIM_FEAS:
1.59 + case CPX_NUM_BEST_FEAS:
1.60 + case CPX_ABORT_FEAS:
1.61 + case CPX_ABORT_PRIM_DUAL_FEAS:
1.62 + return FEASIBLE;
1.63 + break;
1.64 + default:
1.65 + return UNDEFINED; //Everything else comes here
1.66 + //FIXME error
1.67 + }
1.68 +
1.69 +
1.70 + //Nem tudom, hanyas cplex verzio statusai
1.71 // CPX_STAT_ABORT_DUAL_OBJ_LIM
1.72 // CPX_STAT_ABORT_IT_LIM
1.73 // CPX_STAT_ABORT_OBJ_LIM
1.74 @@ -277,25 +341,25 @@
1.75 // CPX_STAT_OPTIMAL_RELAXED
1.76 // CPX_STAT_UNBOUNDED
1.77
1.78 - //Unimplemented
1.79 - int stat = CPXgetstat (env, lp);
1.80 - switch (stat) {
1.81 - case CPX_STAT_OPTIMAL://Optimal
1.82 - return OPTIMAL;
1.83 - break;
1.84 - case CPX_STAT_INFEASIBLE://Infeasible
1.85 - return INFEASIBLE;
1.86 - break;
1.87 - case CPX_STAT_UNBOUNDED://Unbounded
1.88 - return INFINITE;
1.89 - break;
1.90 - case CPX_STAT_NUM_BEST://Feasible
1.91 - return FEASIBLE;
1.92 - break;
1.93 - default:
1.94 - return UNDEFINED; //Everything else comes here
1.95 - //FIXME error
1.96 - }
1.97 +// int stat = CPXgetstat (env, lp);
1.98 +// switch (stat) {
1.99 +// case CPX_STAT_OPTIMAL://Optimal
1.100 +// return OPTIMAL;
1.101 +// break;
1.102 +// case CPX_STAT_INFEASIBLE://Infeasible
1.103 +// return INFEASIBLE;
1.104 +// break;
1.105 +// case CPX_STAT_UNBOUNDED://Unbounded
1.106 +// return INFINITE;
1.107 +// break;
1.108 +// case CPX_STAT_NUM_BEST://Feasible
1.109 +// return FEASIBLE;
1.110 +// break;
1.111 +// default:
1.112 +// return UNDEFINED; //Everything else comes here
1.113 +// //FIXME error
1.114 +// }
1.115 +
1.116 }
1.117
1.118 LpCplex::Value LpCplex::_getPrimal(int i)