Originally posted by: Broncho
Dear all,
In my codes, Matrix is an int type matrix. P is a variable array. I would like to give constraints for my LP problem. So, I define an IloExprArray to record the sum of Matrix*P for each row. But when I run the codes, it is blocked at the line of temp[j]+=Matrix[j][i]*P[i];. I also try to print "temp", nothing can be printed. No problems can be found in Matrix and P because I can print them. I think I may not use IloExprArray correctly. But when I read the references, it looks OK. I don't know the reason why "temp" cannot work. Please help me. Thanks!
IloExprArray temp(env, 70);
for(j=0;j<70;j++)
{
cout<<temp[j]<<endl;
for(i=0;i<60;i++)
{
temp[j]+=Matrix[j][i]*P[i];
}
}
#CPLEXOptimizers#DecisionOptimization