41 namespace Test {
namespace Int {
61 :
Test(
"NValues::Int::Int::"+
str(irt0)+
"::"+
str(n)+
"::"+
str(m0),
78 bool*
v =
new bool[n+1];
79 for (
int i=n+1;
i--; )
104 :
Test(
"NValues::Int::Var::"+
str(irt0)+
"::"+
str(n),n+1,0,n),
110 int n = x.
size() - 1;
111 bool*
v =
new bool[n+1];
112 for (
int i=n+1;
i--; )
121 return cmp(k,irt,x[n]);
125 int n = xy.
size() - 1;
143 :
Test(
"NValues::Bool::Int::"+
str(irt0)+
"::"+
str(n)+
"::"+
str(m0),
152 bool*
v =
new bool[n+1];
153 for (
int i=n+1;
i--; )
168 for (
int i=x.
size();
i--; )
182 :
Test(
"NValues::Bool::Var::"+
str(irt0)+
"::"+
str(n),n+1,0,2),
186 int n = x.
size() - 1;
190 bool*
v =
new bool[n+1];
191 for (
int i=n+1;
i--; )
200 return cmp(k,irt,x[n]);
205 int n = xy.
size() - 1;
219 for (
int i=1;
i<=7;
i += 3) {
220 for (
int m=0;
m<=3;
m++)
224 for (
int i=1;
i<=7;
i += 2) {
225 for (
int m=0;
m<=
i+1;
m++)
226 (
void)
new IntInt(
i,
m, irts.irt());
228 (void)
new IntVar(
i, irts.irt());
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
virtual bool solution(const Assignment &x) const
Test whether x is solution
virtual bool solution(const Assignment &x) const
Test whether x is solution
static bool cmp(T x, Gecode::IntRelType r, T y)
Compare x and y with respect to r.
BoolVar(int n, Gecode::IntRelType irt0)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
IntVar(int n, Gecode::IntRelType irt0)
Create and register test.
Gecode::IntSet dom
Domain of variables.
virtual Assignment * assignment(void) const
Create and register initial assignment.
Generate random selection of assignments.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &xy)
Post constraint on xy.
static std::string str(Gecode::ExtensionalPropKind epk)
Map extensional propagation kind to string.
Test number of values of integer variables equal to integer variable
Gecode::IntArgs i(4, 1, 2, 3, 4)
Help class to create and register tests.
int n
Number of negative literals for node type.
IntRelType
Relation types for integers.
Iterator for integer relation types.
Gecode::IntRelType irt
Integer relation type to propagate.
Gecode::IntRelType irt
Integer relation type to propagate.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Passing integer variables.
Passing Boolean variables.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &xy)
Post constraint on xy.
Test number of values of Boolean variables equal to integer
bool testfix
Whether to perform fixpoint test.
void nvalues(Home home, const BoolVarArgs &x, IntRelType irt, IntVar y, IntConLevel)
Post propagator for .
Node * x
Pointer to corresponding Boolean expression node.
bool testsearch
Whether to perform search test.
BoolInt(int n, int m0, Gecode::IntRelType irt0)
Create and register test.
Gecode::IntRelType irt
Integer relation type to propagate.
Base class for assignments
IntInt(int n, int m0, Gecode::IntRelType irt0)
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 number of values of Boolean variables equal to integer variable
Gecode toplevel namespace
int arity
Number of variables.
Gecode::IntRelType irt
Integer relation type to propagate.
Test number of values of integer variables equal to integer
Create(void)
Perform creation and registration.
int size(void) const
Return size of array (number of elements)
void nvalues(Home home, const IntVarArgs &x, IntRelType irt, int y, IntConLevel)
Post propagator for .
int size(void) const
Return number of variables.
Generate all assignments.