38 namespace Test {
namespace Int {
57 for (
int i=
x.size();
i--; )
65 Gecode::dom(home,
x[0], -2);
67 Gecode::dom(home,
x, -2);
72 assert(
x.size() == 1);
74 Gecode::dom(home,
x[0], -2,
r);
99 for (
int i=
x.size();
i--; )
100 if ((
x[
i] < -2) || (
x[
i] > 2))
107 Gecode::dom(home,
x[0], -2, 2);
109 Gecode::dom(home,
x, -2, 2);
114 assert(
x.size() == 1);
116 Gecode::dom(home,
x[0], -2, 2,
r);
120 Gecode::rel(home, Gecode::dom(
x[0], -2, 2) ==
r.var());
break;
122 Gecode::rel(home, Gecode::dom(
x[0], -2, 2) <<
r.var());
break;
124 Gecode::rel(home, Gecode::dom(
x[0], -2, 2) >>
r.var());
break;
147 Gecode::dom(home,
x[0], 3, 2,
r);
152 const int r[4][2] = {
153 {-4,-3},{-1,-1},{1,1},{3,5}
166 for (
int i=
x.size();
i--; )
167 if (!(((
x[
i] >= -4) && (
x[
i] <= -3)) ||
168 ((
x[
i] >= -1) && (
x[
i] <= -1)) ||
169 ((
x[
i] >= 1) && (
x[
i] <= 1)) ||
170 ((
x[
i] >= 3) && (
x[
i] <= 5))))
177 Gecode::dom(home,
x[0],
d);
179 Gecode::dom(home,
x,
d);
184 assert(
x.size() == 1);
186 Gecode::dom(home,
x[0],
d,
r);
int n
Number of negative literals for node type.
Node * x
Pointer to corresponding Boolean expression node.
Reification specification.
static Gecode::Support::RandomGenerator rand
Random number generator.
Base class for assignments
Test for domain constraint (full integer set)
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x, Gecode::Reify r)
Post reified constraint on x for r.
virtual bool solution(const Assignment &x) const
Test whether x is solution
DomDom(int n)
Create and register test.
Test for domain constraint (integer)
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x, Gecode::Reify r)
Post reified constraint on x for r.
DomInt(int n)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Test for domain constraint (empty range)
virtual void post(Gecode::Space &home, Gecode::IntVarArray &)
Post constraint on x.
virtual bool solution(const Assignment &) const
Test whether x is solution
DomRangeEmpty(void)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x, Gecode::Reify r)
Post reified constraint on x for r.
Test for domain constraint (range)
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x, Gecode::Reify r)
Post reified constraint on x for r.
virtual bool solution(const Assignment &x) const
Test whether x is solution
DomRange(int n)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
static std::string str(Gecode::IntPropLevel ipl)
Map integer propagation level to string.
void fail(void)
Fail space.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
@ RM_IMP
Implication for reification.
@ RM_PMI
Inverse implication for reification.
@ RM_EQV
Equivalence for reification (default)
@ IPL_DOM
Domain propagation Options: basic versus advanced propagation.
Gecode::IntArgs i({1, 2, 3, 4})
#define GECODE_NEVER
Assert that this command is never executed.