Originally posted by: alamaranka
Hi,
I am working on an MIP problem using .NET API. What is I am looking for is to get the array of constraints I have already added to Cplex object as IConstraint[]. However, either it is not possible or I simply failed to find it. After reading and searching related documents I ended up nothing and decided to ask here. I know that:
-
I can create a List<IConstraint>, add all constraints to it as adding them to Cplex object, and use list.ToArray() to get IConstraint[].
-
I can import the model (assuming there is a model to be imported) and use GetLPMatrixEnumerator() to get the ILPMatrix.
However, there is no model to be imported and I do not want to go with List<IConstraint> option since that means extra code. In fact, I would expect as simple as a method to do the job; GetConstraints() on Cplex object which returns IConstraint[]. Is there any?
Regards.
#CPLEXOptimizers#DecisionOptimization