Originally posted by: a.teuffel
Hi,
I build a cplex lp model in a .net application using the .net API. After solving the problem I want to extract the solution values using cplex.getvalues().
When I do this I come across the error: CPLEX Error: object is unknown to IloCplex.
I know what causes the problem thanks to this thread: https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014530212
I use
Dim x As INumVar() = model.NumVarArray(Varname.Count, lb, ub, vartype, varn)
entering the variables with their respective bounds when building the model. The problem is that I can not guarantee that there will be variables added which are not used in any constraint later on.
As I understand,
model.getValues(x)
can only give me the values of variables which are at least occuring in one constraint or objective function.
Can you help me find a way to cope with this? Is there a way to extract a INumVar from the model which contains only the "used" variables which then could be used in getVariables() ?
Or maybe is there a simple way to identify which variables are not used and remove them from x?
#CPLEXOptimizers#DecisionOptimization