Originally posted by: bebulo
I see that ILOSIMPLEXCALLBACK is called at end of each iteration. I can access the status and objective value in the callback, but how can I access the current solution?
edit:
static ILOBARRIERCALLBACK2(MyCallback, IloCplex, cplex, IloNumVarArray, x) {
cout << "Iteration " << getNiterations() << ": ";
if (isFeasible()) {
cout << "Objective = " << getObjValue() << endl;
//cout << "x[0] = " << (float)cplex.getValue(x[0]) << endl;
//Concert exception caught: CPLEX Error 1217: No solution exists.
}
else {
cout << "Infeasibility measure = " << getInfeasibility() << endl;
}
}
#CPLEXOptimizers#DecisionOptimization