Originally posted by: has246
I have a model which i want to apply. The objective function is as follows:
Ithe x is a binary variable which is held in a IloIntVar[][][]
the second part on the right was easy. My problem is with the left part.
I tried ti do it as follows
for (int i = 1; i <= 5; i++)
{
IloLinearIntExpr exp = cplex.linearIntExpr();
for (int j = 1; j <= 4; j++)
{
for ( int k = 1; k <= 3; k++)
{
// this is my problem
exp.addTerm(1, x[i][r][p]);
}
}
}
how do I add the: 1 - the term here?
and how do I multiply it by 5. I tried it alot and I cant cast Ilointexpr to IloLinearIntExpr
Thanks for any help
#CPLEXOptimizers#DecisionOptimization