37namespace Test {
namespace Int {
74 bool* v =
new bool[
n+1];
75 for (
int i=
n+1; i--; )
106 int n =
x.size() - 1;
107 bool* v =
new bool[
n+1];
108 for (
int i=
n+1; i--; )
121 int n = xy.
size() - 1;
148 bool* v =
new bool[
n+1];
149 for (
int i=
n+1; i--; )
164 for (
int i=
x.
size(); i--; )
165 y[i] = channel(home,
x[i]);
166 nvalues(home, y,
irt,
m);
178 :
Test(
"NValues::Bool::Var::"+
str(irt0)+
"::"+
str(
n),
n+1,0,2),
182 int n =
x.size() - 1;
186 bool* v =
new bool[
n+1];
187 for (
int i=
n+1; i--; )
201 int n = xy.
size() - 1;
204 x[i] = channel(home, xy[i]);
205 nvalues(home,
x,
irt, xy[
n]);
215 for (
int i=1; i<=7; i += 3) {
216 for (
int m=0; m<=3; m++)
217 (
void)
new BoolInt(i, m, irts.irt());
218 (void)
new BoolVar(i, irts.irt());
220 for (
int i=1; i<=7; i += 2) {
221 for (
int m=0; m<=i+1; m++)
222 (
void)
new IntInt(i, m, irts.irt());
224 (void)
new IntVar(i, irts.irt());
int n
Number of negative literals for node type.
Node * x
Pointer to corresponding Boolean expression node.
int size(void) const
Return size of array (number of elements)
Passing Boolean variables.
Passing integer variables.
int size(void) const
Return size of array (number of elements)
Base class for assignments
Generate all assignments.
Iterator for integer relation types.
Test number of values of Boolean variables equal to integer
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
virtual bool solution(const Assignment &x) const
Test whether x is solution
BoolInt(int n, int m0, Gecode::IntRelType irt0)
Create and register test.
Gecode::IntRelType irt
Integer relation type to propagate.
Test number of values of Boolean variables equal to integer variable
Gecode::IntRelType irt
Integer relation type to propagate.
virtual bool solution(const Assignment &x) const
Test whether x is solution
BoolVar(int n, Gecode::IntRelType irt0)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &xy)
Post constraint on xy.
Help class to create and register tests.
Create(void)
Perform creation and registration.
Test number of values of integer variables equal to integer
virtual bool solution(const Assignment &x) const
Test whether x is solution
Gecode::IntRelType irt
Integer relation type to propagate.
IntInt(int n, int m0, Gecode::IntRelType irt0)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
virtual Assignment * assignment(void) const
Create and register initial assignment.
Test number of values of integer variables equal to integer variable
Gecode::IntRelType irt
Integer relation type to propagate.
virtual bool solution(const Assignment &x) const
Test whether x is solution
IntVar(int n, Gecode::IntRelType irt0)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &xy)
Post constraint on xy.
Generate random selection of assignments.
bool testsearch
Whether to perform search test.
bool testfix
Whether to perform fixpoint test.
int arity
Number of variables.
static std::string str(Gecode::IntPropLevel ipl)
Map integer propagation level to string.
static bool cmp(T x, Gecode::IntRelType r, T y)
Compare x and y with respect to r.
Gecode::IntSet dom
Domain of variables.
IntRelType
Relation types for integers.
Gecode toplevel namespace
void nvalues(Home home, const IntVarArgs &x, IntRelType irt, int y, IntPropLevel ipl=IPL_DEF)
Post propagator for .