Originally posted by: Ximenes
Hi, everyone, I strongly suspect that my definition of 6-dimmensional array is not perfectly right.
I pasted the related code bellow hoping that somebody can give me some suggestions.
typedef IloArray<IloBoolVarArray> BoolVarMatrix; typedef IloArray<IloNumVarArray> NumVarMatrix; typedef IloArray<BoolVarMatrix> BoolVar3Matrix; typedef IloArray<BoolVar3Matrix> BoolVar4Matrix; typedef IloArray<BoolVar4Matrix> BoolVar5Matrix; typedef IloArray<BoolVar5Matrix> BoolVar6Matrix;
and
BoolVar6Matrix a(env,N);
//定义a 【a(i,k,m,j,l,h)=z(i,k,m)*z(j,l,h)】
for(
int i=0;i<N;i++)
{ a[i]=BoolVar5Matrix(env,n[i]);
for(
int k=0;k<n[i];k++)
{ a[i][k]=BoolVar4Matrix(env,total);
for(
int m=0;m<total;m++)
{ a[i][k][m]=BoolVar3Matrix(env,N);
for(
int j=0;j<N;j++)
{ a[i][k][m][j]=BoolVarMatrix(env,n[j]);
for(
int l=0;l<n[l];l++) a[i][k][m][j][l]=IloBoolVarArray(env,total);
}
}
}
}
Thank you.
#CPLEXOptimizers#DecisionOptimization