Originally posted by: SystemAdmin
That is, for a given IloNumVar x you want to know in which constraints this variable appears and what the coefficient in that constraint is?
AFAIK there is no easy way to do this. You would have to iterate of all constraints in the model and build that column yourself:
for (IloModel::Iterator it(cplex.getModel()); it.ok; ++it) {
IloExtrable e = *it;
if (e.isConstraint()) {
IloConstraint c = e.asConstraint();
// Test if x is in c and find the coefficient
...
}
}
In other words, it is probably a lot easier/faster to keep track of this yourself :-(
#CPLEXOptimizers#DecisionOptimization