# HG changeset patch # User athos # Date 1115393973 0 # Node ID 7152559e3d087ba3cb475dcbc556c724bad3b7d4 # Parent 15dac8ae3f8c1b7c598896ce8e011a52197d3e93 Cplex works. diff -r 15dac8ae3f8c -r 7152559e3d08 src/lemon/lp_cplex.cc --- a/src/lemon/lp_cplex.cc Thu May 05 15:47:45 2005 +0000 +++ b/src/lemon/lp_cplex.cc Fri May 06 15:39:33 2005 +0000 @@ -261,6 +261,70 @@ LpCplex::SolutionStatus LpCplex::_getPrimalStatus() { +//7.5-os cplex statusai +// #define CPX_OPTIMAL 1 +// #define CPX_INFEASIBLE 2 +// #define CPX_UNBOUNDED 3 +// #define CPX_OBJ_LIM 4 +// #define CPX_IT_LIM_FEAS 5 +// #define CPX_IT_LIM_INFEAS 6 +// #define CPX_TIME_LIM_FEAS 7 +// #define CPX_TIME_LIM_INFEAS 8 +// #define CPX_NUM_BEST_FEAS 9 +// #define CPX_NUM_BEST_INFEAS 10 +// #define CPX_OPTIMAL_INFEAS 11 +// #define CPX_ABORT_FEAS 12 +// #define CPX_ABORT_INFEAS 13 +// #define CPX_ABORT_DUAL_INFEAS 14 +// #define CPX_ABORT_PRIM_INFEAS 15 +// #define CPX_ABORT_PRIM_DUAL_INFEAS 16 +// #define CPX_ABORT_PRIM_DUAL_FEAS 17 +// #define CPX_ABORT_CROSSOVER 18 +// #define CPX_INForUNBD 19 +// #define CPX_PIVOT 20 + +// Ezeket hova tegyem: +// ??case CPX_ABORT_DUAL_INFEAS +// ??case CPX_ABORT_CROSSOVER +// ??case CPX_INForUNBD +// ??case CPX_PIVOT + + int stat = CPXgetstat (env, lp); + switch (stat) { + case 0: + return UNDEFINED; //Undefined + break; + case CPX_OPTIMAL://Optimal + return OPTIMAL; + break; + case CPX_UNBOUNDED://Unbounded + return INFINITE; + break; + case CPX_INFEASIBLE://Infeasible + case CPX_IT_LIM_INFEAS: + case CPX_TIME_LIM_INFEAS: + case CPX_NUM_BEST_INFEAS: + case CPX_OPTIMAL_INFEAS: + case CPX_ABORT_INFEAS: + case CPX_ABORT_PRIM_INFEAS: + case CPX_ABORT_PRIM_DUAL_INFEAS: + return INFEASIBLE; + break; + case CPX_OBJ_LIM: + case CPX_IT_LIM_FEAS: + case CPX_TIME_LIM_FEAS: + case CPX_NUM_BEST_FEAS: + case CPX_ABORT_FEAS: + case CPX_ABORT_PRIM_DUAL_FEAS: + return FEASIBLE; + break; + default: + return UNDEFINED; //Everything else comes here + //FIXME error + } + + + //Nem tudom, hanyas cplex verzio statusai // CPX_STAT_ABORT_DUAL_OBJ_LIM // CPX_STAT_ABORT_IT_LIM // CPX_STAT_ABORT_OBJ_LIM @@ -277,25 +341,25 @@ // CPX_STAT_OPTIMAL_RELAXED // CPX_STAT_UNBOUNDED - //Unimplemented - int stat = CPXgetstat (env, lp); - switch (stat) { - case CPX_STAT_OPTIMAL://Optimal - return OPTIMAL; - break; - case CPX_STAT_INFEASIBLE://Infeasible - return INFEASIBLE; - break; - case CPX_STAT_UNBOUNDED://Unbounded - return INFINITE; - break; - case CPX_STAT_NUM_BEST://Feasible - return FEASIBLE; - break; - default: - return UNDEFINED; //Everything else comes here - //FIXME error - } +// int stat = CPXgetstat (env, lp); +// switch (stat) { +// case CPX_STAT_OPTIMAL://Optimal +// return OPTIMAL; +// break; +// case CPX_STAT_INFEASIBLE://Infeasible +// return INFEASIBLE; +// break; +// case CPX_STAT_UNBOUNDED://Unbounded +// return INFINITE; +// break; +// case CPX_STAT_NUM_BEST://Feasible +// return FEASIBLE; +// break; +// default: +// return UNDEFINED; //Everything else comes here +// //FIXME error +// } + } LpCplex::Value LpCplex::_getPrimal(int i)