【发布时间】:2015-12-16 09:10:25
【问题描述】:
我想在一次 Barrier 算法迭代后访问 QP 的当前解决方案。每次迭代后都会触发一个回调ContinuousCallbackI。 我修改了回调代码示例:
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;
//CPLEX Error 1217: No solution exists.
}
else {
cout << "Infeasibility measure = " << getInfeasibility() << endl;
}
}
但是 cplex 没有解决方案(错误)。有什么方法可以在迭代后访问当前的解决方案?
【问题讨论】: