Originally posted by: ol
IlcConstraint IlcCardIntEqCst(const IlcIntExp var, IlcInt val, const IlcIntVarArray vars) returns a constraint that ensures that val appears var times in the array vars.
For building an expression at the Ilc level, you are right, this is exactly as at the Ilo Level, but with IlcIntExp, for example:
IlcIntVarArray x(m,3,1,2);
IlcIntVar xx(m,1,3,"xx");
IlcIntExp e = IlcIntExp(x[0]==1);
for(IlcInt i = 1;i<3;i++) {
e = e + (x[i]==1);
}
Regards,
Olivier
#CPOptimizer#DecisionOptimization