40 namespace Gecode {
namespace Int {
namespace Arithmetic {
47 template<
class VA,
class VB,
class VC>
53 template<
class VA,
class VB,
class VC>
59 template<
class VA,
class VB,
class VC>
65 template<
class VA,
class VB,
class VC>
85 return x0.assigned() &&
x1.assigned() ?
89 template<
class VA,
class VB,
class VC>
134 if (
pos(
x0))
goto rewrite_ppp;
135 if (
neg(
x0))
goto rewrite_nnp;
139 if (
pos(
x0))
goto rewrite_pnn;
140 if (
neg(
x0))
goto rewrite_npn;
156 if (
pos(
x0))
goto rewrite_ppp;
157 if (
neg(
x0))
goto rewrite_nnp;
162 if (
x0.assigned() &&
x1.assigned())
172 if (
pos(
x0))
goto rewrite_ppp;
173 if (
neg(
x0))
goto rewrite_npn;
178 if (
x0.assigned() &&
x1.assigned())
188 if (
pos(
x0))
goto rewrite_pnn;
189 if (
neg(
x0))
goto rewrite_npn;
196 if (
x0.assigned() &&
x1.assigned())
206 if (
pos(
x0))
goto rewrite_pnn;
207 if (
neg(
x0))
goto rewrite_nnp;
212 if (
x0.assigned() &&
x1.assigned())
229 assert(
x0.assigned() &&
x1.assigned());
231 if (
x0.val()/
x1.val() < 0)
242 if (
pos(x1) ||
pos(x2))
goto post_ppp;
243 if (
neg(x1) ||
neg(x2))
goto post_pnn;
244 }
else if (
neg(x0)) {
245 if (
neg(x1) ||
pos(x2))
goto post_nnp;
246 if (
pos(x1) ||
neg(x2))
goto post_npn;
247 }
else if (
pos(x1)) {
248 if (
pos(x2))
goto post_ppp;
249 if (
neg(x2))
goto post_npn;
250 }
else if (
neg(x1)) {
251 if (
pos(x2))
goto post_nnp;
252 if (
neg(x2))
goto post_pnn;
310 }
else if (
x0.max() <= 0) {
312 }
else if (
x2.min() > 0) {
314 }
else if (
x2.max() < 0) {
329 }
while (!signIsSame &&
330 (
x0.min() > 0 ||
x0.max() < 0 ||
x2.min() > 0 ||
x2.max() < 0));
336 if (x2max < x1absmin)
IntType ceil_div_pp(IntType x, IntType y)
Compute where x and y are non-negative.
void mod(Home home, IntVar x0, IntVar x1, IntVar x2, IntPropLevel ipl)
Post propagator for .
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
Bounds consistent positive division propagator.
Integer division/modulo propagator.
bool any(const View &x)
Test whether x is neither positive nor negative.
Range iterator for singleton range.
ExecStatus ES_SUBSUMED(Propagator &p)
const FloatNum max
Largest allowed float value.
ExecStatus subsumed(Space &home, Propagator &p, int c, TaskArray< Task > &t)
Check for subsumption (all tasks must be assigned)
DivPlusBnd(Home home, VA x0, VB x1, VC x2)
Constructor for posting.
long long int ll(int x)
Cast x into a long long int.
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
virtual Actor * copy(Space &home)
Copy propagator during cloning.
long long int mll(long long int x, long long int y)
Multiply x and .
IntType floor_div_xx(IntType x, IntType y)
Compute .
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Propagation has computed fixpoint.
#define GECODE_ME_CHECK_MODIFIED(modified, me)
Check whether me is failed or modified, and forward failure.
Base-class for both propagators and branchers.
long long int ill(int x)
Increment x by one.
int p
Number of positive literals for node type.
const FloatNum min
Smallest allowed float value.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Mixed ternary propagator.
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
IntType floor_div_pp(IntType x, IntType y)
Compute where x and y are non-negative.
DivBnd(Space &home, DivBnd< View > &p)
Constructor for cloning p.
IntType floor_div_xp(IntType x, IntType y)
Compute where y is non-negative.
IntType ceil_div_xp(IntType x, IntType y)
Compute where y is non-negative.
IntType ceil_div_xx(IntType x, IntType y)
Compute .
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
Bounds consistent division propagator.
DivMod(Space &home, DivMod< View > &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
IntType floor_div_px(IntType x, IntType y)
Compute where x is non-negative.
bool pos(const View &x)
Test whether x is postive.
long long int dll(int x)
Decrement x by one.
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.
Propagation has not computed fixpoint.
static ExecStatus post(Home home, View x0, View x1, View x2)
Post propagator .
Gecode toplevel namespace
int ModEventDelta
Modification event deltas.
static ExecStatus post(Home home, VA x0, VB x1, VC x2)
Post propagator (rounding towards 0)
Home class for posting propagators
virtual Actor * copy(Space &home)
Copy propagator during cloning.
bool neg(const View &x)
Test whether x is negative.