Re: [gecode-users] Modulo operator

2008-08-25 Thread Christian Schulte
Toro Sent: Monday, August 25, 2008 3:40 PM To: gecode list Subject: Re: [gecode-users] Modulo operator Hello, I am trying to write this reified constraint. (a mod c = d) <-> b where a,c,d are IntVars and b is BoolVar. In the past, you recommend to represent A = (B - C) mod n

Re: [gecode-users] Modulo operator

2008-08-25 Thread Mauricio Toro
Hello, I am trying to write this reified constraint. (a mod c = d) <-> b where a,c,d are IntVars and b is BoolVar. In the past, you recommend to represent A = (B - C) mod n as A = (B-C) + n * X. But, now I am wondering how can I write a reified propagator for (a mod c = d) <-> b. Thanks, Maur

Re: [gecode-users] Modulo operator

2008-05-13 Thread Guido Tack
Malcolm Ryan wrote: > I'd like to express the constraint: > > A = (B - C) mod n > 0 <= A < n > > for variables A,B,C and constant n. > > How would you advise doing this? The obvious answer is to add an extra > variable X: > > A = (B-C) + n * X > 0 <= A < n > > but I'm not sure if this is best. Can

[gecode-users] Modulo operator

2008-05-13 Thread Malcolm Ryan
I'd like to express the constraint: A = (B - C) mod n 0 <= A < n for variables A,B,C and constant n. How would you advise doing this? The obvious answer is to add an extra variable X: A = (B-C) + n * X 0 <= A < n but I'm not sure if this is best. Can you advise? Malcolm __