Originally posted by: jefflee2011
I am using Cplex 12.3 with vs2008.
The pseudo-code is as follows.
IloExprArray exprA;
...
function1
{
IloExpr expr(env);
...
exprA.add(expr);
}
...
function2
{
for(i=1;i<n;i++)
{
...
function1;
}
}
In the loop, each time
function1 is executed, the element added into IloExprArray last time disappears. In other words, the element is added to
the first position of
exprA every time in the loop. I guess
expr is deleted after
function1 is executed, causing elements not really added into IloExprArray. I don't know how to solve the problem.
#CPLEXOptimizers#DecisionOptimization