Originally posted by: Selectedbetter
Hello everyone, we need some help about how to sum a const IloNumArray3, the question is:
At the first, we have "const IloIntVarArray3 x" in the void();
Let the x[i][j][k] represent the IloIntVarArray3 x.
Then, we want to sum all k in a given i and j, that is sum (x[i][j]), but we don't know how to do with.
We have tried like:
IloExpr expr(env);
for(k=0;k<n;++k)
{
expr+=x[i][j][k];
}
but we got an error says"IloExpr& IloNumExpr::operator+=const IloIntVar arg: mixing mismatch Environments" .
Wish all of you a happy new year!
#CPLEXOptimizers#DecisionOptimization