Originally posted by: SystemAdmin
Hello ^^
sorry I forgot to translate the error message ^ ^ ( ps : I'm not very good in english :/ i speak frech )
What i want to do is :
1 / calculate the sum of I
nbmachines[i] , where i=1...nbjobs-1
I is an array of variable , for exemple , if nbjobs=3, and nbmachines=3 , then we have an array of 2 dimension ( number of line=nbmachines and number of column=nbjobs ), and each case ( I[1][1],I[1][2],I[1][3],I[2][1],I[2][2],I[2][3], I[3][1],I[3][2],I[3][3] ) , is a variable whose its value is between 0 and 10000
so in my program i wrote :
typedef IloArray<IloNumVarArray> NumVarMatrix; NumVarMatrix I(env, nbmachines-1);
for (j = 0; j < nbmachines-1; j++)
{ I[j] = IloNumVarArray (env,nbjobs-1,0,100000,ILOFLOAT);
}
2 / i want to calculate :
double sum of (x [i][1] time p[i][j] ) ,for i=1..nbjobs , and j=1..nbmachines-1
such that :
x is an array of variable , like I , of 2 dimension (number of line =nbjobs ,number of column =nbjobs)
and p[i][j] is a constante array of 2 dimension
in my code i have :
// for x :
typedef IloArray<IloNumVarArray> NumVarMatrix; NumVarMatrix x(env, nbjobs);
for (j = 0; j < nbjobs; j++)
{ x[j] = IloNumVarArray(env, nbjobs, 0.0, 1.0, ILOFLOAT);
}
//for p :
int tab[nbjobs][nbmachines];
for (k=0;k<nbmahines;k++)
{
for (j=0;j<nbjobs;j++)
{ tab [j][k]=rand()%99; cout << tab[j][k] <<
" ";
} cout <<
" " <<
"\n" ;
}
^^
#CPLEXOptimizers#DecisionOptimization