40 namespace Gecode {
namespace Int {
namespace Arithmetic {
47 template<
class VA,
class VB,
class VC>
53 template<
class VA,
class VB,
class VC>
60 template<
class VA,
class VB,
class VC>
66 template<
class VA,
class VB,
class VC>
86 return x0.assigned() && x1.assigned() ?
90 template<
class VA,
class VB,
class VC>
125 if (
pos(x2) ||
pos(x0))
goto rewrite_ppp;
126 if (
neg(x2) ||
neg(x0))
goto rewrite_npn;
130 if (
neg(x2) ||
pos(x0))
goto rewrite_pnn;
131 if (
pos(x2) ||
neg(x0))
goto rewrite_nnp;
135 if (
pos(x0))
goto rewrite_ppp;
136 if (
neg(x0))
goto rewrite_nnp;
140 if (
pos(x0))
goto rewrite_pnn;
141 if (
neg(x0))
goto rewrite_npn;
144 assert(
any(x1) &&
any(x2));
146 mll(x1.min(),
dll(x2.min()))-1)));
148 mll(x1.max(),
dll(x2.min())))));
157 if (
pos(x0))
goto rewrite_ppp;
158 if (
neg(x0))
goto rewrite_nnp;
163 if (x0.assigned() && x1.assigned())
173 if (
pos(x0))
goto rewrite_ppp;
174 if (
neg(x0))
goto rewrite_npn;
179 if (x0.assigned() && x1.assigned())
189 if (
pos(x0))
goto rewrite_pnn;
190 if (
neg(x0))
goto rewrite_npn;
197 if (x0.assigned() && x1.assigned())
207 if (
pos(x0))
goto rewrite_pnn;
208 if (
neg(x0))
goto rewrite_nnp;
213 if (x0.assigned() && x1.assigned())
219 ::
post(home(*
this),x0,x1,x2)));
230 assert(x0.assigned() && x1.assigned());
232 if (x0.val()/x1.val() < 0)
243 if (
pos(x1) ||
pos(x2))
goto post_ppp;
244 if (
neg(x1) ||
neg(x2))
goto post_pnn;
245 }
else if (
neg(x0)) {
246 if (
neg(x1) ||
pos(x2))
goto post_nnp;
247 if (
pos(x1) ||
neg(x2))
goto post_npn;
248 }
else if (
pos(x1)) {
249 if (
pos(x2))
goto post_ppp;
250 if (
neg(x2))
goto post_npn;
251 }
else if (
neg(x1)) {
252 if (
pos(x2))
goto post_nnp;
253 if (
neg(x2))
goto post_pnn;
311 }
else if (x0.max() <= 0) {
313 }
else if (x2.min() > 0) {
315 }
else if (x2.max() < 0) {
327 int x2absmin =
any(x2) ? 0 : (
pos(x2) ? x2.min() : -x2.max());
330 }
while (!signIsSame &&
331 (x0.min() > 0 || x0.max() < 0 || x2.min() > 0 || x2.max() < 0));
336 int x1absmin =
any(x1) ? 0 : (
pos(x1) ? x1.min() : -x1.max());
337 if (x2max < x1absmin)