Originally posted by: SystemAdmin
First, I'm not sure I would trust assigning the value of getStatus to an IloNum. IloCplex::getStatus returns an enumeration (type IloAlgorithm::Status), and while I don't know that it actually happens, conceivably the CPLEX developers could change the indexing of that enumeration from one version to the next. You might try
IloAlgorithm::Status status = cplex.getStatus();
if (status == IloAlgorithm::Status::Optimal) { ... }
to verify that you're really getting an optimal solution.
Also, it might be useful to check cplex.getCplexStatus(), which returns an enumeration (IloCplex::CplexStatus) that's a bit more granular.
/Paul
Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
#CPLEXOptimizers#DecisionOptimization