Originally posted by: srinit34
Hi
I import a model like this:
cplex = new IloCplex ();
cplex.importModel(MIP_FILENAME);
if I delete constraints using delete, it works, but not with remove
IloLPMatrix lpMatrix = (IloLPMatrix)cplex.LPMatrixIterator().next();
IloRange[] constraints = lpMatrix.getRanges();
for (IloRange constr: constraints ){
cplex.delete(constr) ;
}
Here is my problem:
If I try to add a constraint it does not add it to the cplex object, although the return value is okay.
IloRange addedConstr = cplex.addLe(constarintExpression, bound);
I recall reading somewhere about editing an imported model (not sure if my usage is correct).
Please clarify.
I am trying to avoid the effort of creating all the variables by myself and adding them, the objective, and the constraints. I just want to import the model and edit it as I desire.
#CPLEXOptimizers#DecisionOptimization