Originally posted by: UserCplex
Greetings,
I have defined the following.
IloEnv env;
IloCplex cplex(env);
IloNumVarArray y(env, MAX_SIZE, 0, IloInfinity, ILOINT);
IloNumArray yvalues(env, MAX_SIZE);
Somewhere later in the code, I solve the cplex instance using
cplex.solve();
After this, when I try
cplex.getValues(y, yvalues);
CPLEX throws an exception.
To drill down further, I changed yvalues as follows:
double yvalues[MAX_SIZE];
and tried to access solution values using individual cplex.getValue() function calls as follows:
for(int i = 0; i < MAX_SIZE; i++){
cout<<i<<endl;
yvalues[i] = cplex.getValue(y[i]);
}
The trouble is that i never reaches MAX_SIZE - 1. It stops somewhere halfway with the exception:
IloAlgorithm::NotExtractedException at memory location 0x0018f640..
That is, some of the .getValue() functions work, while the others do not.
Am I doing something wrong here? Or is this a bug in CPLEX 12.6.0?
Thanks in advance.
#CPLEXOptimizers#DecisionOptimization