diff -r 2ee881cf30a8 -r 7c58aabb9eea lemon/lp_cplex.cc --- a/lemon/lp_cplex.cc Thu Jun 09 09:49:56 2005 +0000 +++ b/lemon/lp_cplex.cc Thu Jun 09 15:03:58 2005 +0000 @@ -260,6 +260,21 @@ } } + LpCplex::Value LpCplex::_getPrimal(int i) + { + Value x; + CPXgetx (env, lp, &x, i, i); + return x; + } + + LpCplex::Value LpCplex::_getPrimalValue() + { + Value objval; + //method = CPXgetmethod (env, lp); + status = CPXgetobjval (env, lp, &objval); + return objval; + } + //7.5-os cplex statusai (Vigyazat: a 9.0-asei masok!) // This table lists the statuses, returned by the CPXgetstat() routine, for solutions to LP problems or mixed integer problems. If no solution exists, the return value is zero. @@ -377,22 +392,24 @@ //FIXME error } - LpCplex::Value LpCplex::_getPrimal(int i) + + LpCplex::ProblemTypes LpCplex::_getProblemType() { - Value x; - CPXgetx (env, lp, &x, i, i); - return x; - } - - LpCplex::Value LpCplex::_getPrimalValue() - { - Value objval; - //method = CPXgetmethod (env, lp); - status = CPXgetobjval (env, lp, &objval); - return objval; - } - - + int stat = CPXgetstat (env, lp); + switch (stat) { + case CPX_OPTIMAL://Optimal + return PRIMAL_DUAL_FEASIBLE; + case CPX_UNBOUNDED: + return PRIMAL_FEASIBLE_DUAL_INFEASIBLE; +// return PRIMAL_INFEASIBLE_DUAL_FEASIBLE; +// return PRIMAL_DUAL_INFEASIBLE; + +//Seems to be that this is all we can say for sure + default: + //In all other cases + return UNKNOWN; + //FIXME error + } void LpCplex::_setMax()