Jeffrey wrote: > Are the following three constraints equivalent? > > Objective: To extract the d.val() th element in tmpArray into an > IntValArray groupStudentVal so that further constraint can be > written on it.
What's an IntValArray? > tmpArray is int[] > groupStudentVal is IntValArray > d is SetVarGlbValue of a SetVar What's a SetVarGlbValue? > (1) post(this, tmpArray[d.val()] == groupStudentVal[index]); > (2) rel(this, groupStudentVal[index], IRT_EQ, tmpArray[d.val()]); > (3) post(this, tt(groupStudentVal[index]==tmpArray[d.val()])); All three statements should do the same thing. However, I don't understand what d.val() is, and if d is an IntVar, you cannot use its value when posting constraints, as the value will only be determined after solving the problem. Cheers, Guido _______________________________________________ Gecode users mailing list us...@gecode.org https://www.gecode.org/mailman/listinfo/gecode-users