Originally posted by: SystemAdmin
Hello,
I have one 2D and one 3D boolean arrays that I defined as:
typedef IloArray<IloBoolVarArray> ArrayVar2D; typedef IloArray<IloArray<IloBoolVarArray> > ArrayVar3D;
and
IloEnv env; IloModel model(env); IloCplex cplex(env);
and
ArrayVar2D yir (env, 10); ArrayVar3D wijr (env, 10);
for (
int a=0; a<10; a++)
{ xij[a] = IloBoolVarArray(env, 10); yir[a] = IloBoolVarArray(env, 10); wijr[a] = ArrayVar2D(env, 10);
for (
int b=0; b<10; b++)
{ wijr[a][b] = IloBoolVarArray(env, 10);
}
}
It compiles, and CPLEX solves the model. My Problem: when I try to get the values. The code:
for (
int b=0; b<10; b++)
{
for (
int a=0; a<10; a++)
{ cout <<
"\t" << cplex.getValue(yir[b][a]);
} cout << endl;
}
Works fine. But I couldn't get the results from the 3D matrix. The code:
for (
int c=0; c<10; c++)
{ cout <<
"c="<<c<<endl;
for (
int b=0; b<10; b++)
{ cout <<
" "<<b;
for (
int a=0; a<10; a++)
{ cout <<
"\t" << cplex.getValue(wijr[b][a][c]);
} cout << endl;
}
}
Gives me:
Error: IloExtractable 11 IloNumVarI has not been extracted by IloAlgorithm 0x9848ab0
Does anyone have any idea?
Thanks!!!
#DecisionOptimization#OPLusingCPLEXOptimizer