Originally posted by: SystemAdmin
[bistra said:]
Hi,
I have been fighting with this and cannot understand why it is happening.
I have an array of IloNumExpr's powExpr[][] that are highly nonlinear (constructing using IloPower etc)
then i create my obj function as a sum of these expressions.
Adding a bounding constraint to the obj works.
But when i try ot add a bounding constraint to the powExpr i get the exception.
Please help.
IloNumExpr obj(env);
for(i = 0; i < numloc; i++){<br /> for(j = 1; j <= numAngles; j++){<br /> obj += powExpr[j][i];
}
}
model.add(IloMaximize(env, obj));
model.add(0 <= obj); // works<br /> for(i = 0; i < numloc; i++){<br /> for(j = 1; j <= numAngles; j++){<br /> model.add(0 <= powExpr[j][i]); // bombs!!!<br /> }
}
#CPOptimizer#DecisionOptimization