43 template<
class VA,
class VB,
class VC>
49 template<
class VA,
class VB,
class VC>
55 template<
class VA,
class VB,
class VC>
61 template<
class VA,
class VB,
class VC>
81 return x0.assigned() &&
x1.assigned() ?
85 template<
class VA,
class VB,
class VC>
130 if (
pos(
x0))
goto rewrite_ppp;
131 if (
neg(
x0))
goto rewrite_nnp;
135 if (
pos(
x0))
goto rewrite_pnn;
136 if (
neg(
x0))
goto rewrite_npn;
152 if (
pos(
x0))
goto rewrite_ppp;
153 if (
neg(
x0))
goto rewrite_nnp;
158 if (
x0.assigned() &&
x1.assigned())
168 if (
pos(
x0))
goto rewrite_ppp;
169 if (
neg(
x0))
goto rewrite_npn;
174 if (
x0.assigned() &&
x1.assigned())
184 if (
pos(
x0))
goto rewrite_pnn;
185 if (
neg(
x0))
goto rewrite_npn;
192 if (
x0.assigned() &&
x1.assigned())
202 if (
pos(
x0))
goto rewrite_pnn;
203 if (
neg(
x0))
goto rewrite_nnp;
208 if (
x0.assigned() &&
x1.assigned())
225 assert(
x0.assigned() &&
x1.assigned());
226 int result = std::abs(
x0.val()) / std::abs(
x1.val());
227 if (
x0.val()/
x1.val() < 0)
240 }
else if (
neg(
x0)) {
243 }
else if (
pos(
x1)) {
244 if (
pos(
x2))
goto post_ppp;
245 if (
neg(
x2))
goto post_npn;
246 }
else if (
neg(
x1)) {
247 if (
pos(
x2))
goto post_nnp;
248 if (
neg(
x2))
goto post_pnn;
306 }
else if (
x0.max() <= 0) {
308 }
else if (
x2.min() > 0) {
310 }
else if (
x2.max() < 0) {
317 int x1max = std::max(
x1.max(),std::max(-
x1.max(),
318 std::max(
x1.min(),-
x1.min())));
325 }
while (!signIsSame &&
326 (
x0.min() > 0 ||
x0.max() < 0 ||
x2.min() > 0 ||
x2.max() < 0));
329 int x2max = std::max(
x2.max(),std::max(-
x2.max(),
330 std::max(
x2.min(),-
x2.min())));
332 if (x2max < x1absmin)
Base-class for both propagators and branchers.
Home class for posting propagators
virtual Actor * copy(Space &home)
Copy propagator during cloning.
DivBnd(Space &home, DivBnd< View > &p)
Constructor for cloning p.
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator (rounding towards 0)
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator .
virtual Actor * copy(Space &home)
Copy propagator during cloning.
DivMod(Space &home, DivMod< View > &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Bounds consistent positive division propagator.
static ExecStatus post(Home home, VA x0, VB x1, VC x2)
Post propagator (rounding towards 0)
virtual Actor * copy(Space &home)
Copy propagator during cloning.
DivPlusBnd(Home home, VA x0, VB x1, VC x2)
Constructor for posting.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Range iterator for singleton range.
MixTernaryPropagator(Space &home, MixTernaryPropagator &p)
TernaryPropagator(Space &home, TernaryPropagator &p)
ExecStatus ES_SUBSUMED(Propagator &p)
Propagator p is subsumed
int ModEventDelta
Modification event deltas.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
#define GECODE_ME_CHECK_MODIFIED(modified, me)
Check whether me is failed or modified, and forward failure.
Numerical (arithmetic) propagators.
long long int dll(int x)
Decrement x by one.
bool pos(const View &x)
Test whether x is postive.
bool any(const View &x)
Test whether x is neither positive nor negative.
long long int mll(long long int x, long long int y)
Multiply x and \y.
long long int ill(int x)
Increment x by one.
bool neg(const View &x)
Test whether x is negative.
long long int ll(int x)
Cast x into a long long int.
IntType ceil_div_pp(IntType x, IntType y)
Compute where x and y are non-negative.
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
IntType ceil_div_xp(IntType x, IntType y)
Compute where y is non-negative.
IntType floor_div_xp(IntType x, IntType y)
Compute where y is non-negative.
IntType floor_div_xx(IntType x, IntType y)
Compute .
IntType floor_div_pp(IntType x, IntType y)
Compute where x and y are non-negative.
IntType ceil_div_xx(IntType x, IntType y)
Compute .
IntType floor_div_px(IntType x, IntType y)
Compute where x is non-negative.
Gecode toplevel namespace
void mod(Home home, IntVar x0, IntVar x1, IntVar x2, IntPropLevel ipl=IPL_DEF)
Post propagator for .
@ ES_OK
Execution is okay.
@ ES_FIX
Propagation has computed fixpoint.
@ ES_NOFIX
Propagation has not computed fixpoint.