38 namespace Test {
namespace Int {
41 namespace MiniModelCount {
68 :
Test(
"MiniModel::"+
expand(irt0)+
"::Int::Int",4,-2,2),
irt(irt0) {}
72 for (
int i=
x.size();
i--; )
81 Gecode::exactly(home,
x,0,2);
break;
83 Gecode::atmost(home,
x,0,2);
break;
85 Gecode::atleast(home,
x,0,2);
break;
99 :
Test(
"MiniModel::"+
expand(irt0)+
"::Int::Var",5,-2,2),
irt(irt0) {}
103 for (
int i=0;
i<4;
i++)
111 for (
int i=0;
i<4;
i++)
115 Gecode::exactly(home,y,0,
x[4]);
break;
117 Gecode::atmost(home,y,0,
x[4]);
break;
119 Gecode::atleast(home,y,0,
x[4]);
break;
133 :
Test(
"MiniModel::"+
expand(irt0)+
"::Var::Var",5,-2,2),
irt(irt0) {}
137 for (
int i=0;
i<3;
i++)
145 for (
int i=0;
i<3;
i++)
149 Gecode::exactly(home,y,
x[3],
x[4]);
break;
151 Gecode::atmost(home,y,
x[3],
x[4]);
break;
153 Gecode::atleast(home,y,
x[3],
x[4]);
break;
167 :
Test(
"MiniModel::"+
expand(irt0)+
"::Var::Int",4,-2,2),
irt(irt0) {}
171 for (
int i=0;
i<3;
i++)
179 for (
int i=0;
i<3;
i++)
183 Gecode::exactly(home,y,
x[3],2);
break;
185 Gecode::atmost(home,y,
x[3],2);
break;
187 Gecode::atleast(home,y,
x[3],2);
break;
203 :
Test(
"MiniModel::"+
expand(irt0)+
"::IntArray::Int",5,-2,2),
208 for (
int i=0;
i<4;
i++)
216 for (
int i=0;
i<4;
i++)
220 Gecode::exactly(home,y,
ints,2);
break;
222 Gecode::atmost(home,y,
ints,2);
break;
224 Gecode::atleast(home,y,
ints,2);
break;
238 :
Test(
"MiniModel::"+
expand(irt0)+
"::IntArray::Var",5,-2,2),
243 for (
int i=0;
i<4;
i++)
251 for (
int i=0;
i<4;
i++)
255 Gecode::exactly(home,y,
ints,
x[4]);
break;
257 Gecode::atmost(home,y,
ints,
x[4]);
break;
259 Gecode::atleast(home,y,
ints,
x[4]);
break;
274 (void)
new IntInt(irts.irt());
275 (void)
new IntVar(irts.irt());
276 (void)
new VarVar(irts.irt());
277 (void)
new VarInt(irts.irt());
Node * x
Pointer to corresponding Boolean expression node.
Passing integer arguments.
Passing integer variables.
Base class for assignments
Iterator for integer relation types.
Help class to create and register tests.
Create(void)
Perform creation and registration.
Test number of several equal integers 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
Gecode::IntRelType irt
Integer relation type to propagate.
IntArrayInt(Gecode::IntRelType irt0)
Create and register test.
Test number of several equal integers equal to integer variable
Gecode::IntRelType irt
Integer relation type to propagate.
virtual bool solution(const Assignment &x) const
Test whether x is solution
IntArrayVar(Gecode::IntRelType irt0)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Test number of equal integers equal to integer
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
IntInt(Gecode::IntRelType irt0)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Gecode::IntRelType irt
Integer relation type to propagate.
Test number of equal integers equal to integer variable
Gecode::IntRelType irt
Integer relation type to propagate.
IntVar(Gecode::IntRelType irt0)
Create and register test.
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
Test number of equal variables equal to integer
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
VarInt(Gecode::IntRelType irt0)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Gecode::IntRelType irt
Integer relation type to propagate.
Test number of equal variables equal to integer variable
VarVar(Gecode::IntRelType irt0)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Gecode::IntRelType irt
Integer relation type to propagate.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
static bool cmp(T x, Gecode::IntRelType r, T y)
Compare x and y with respect to r.
IntRelType
Relation types for integers.
@ IRT_GQ
Greater or equal ( )
@ IRT_LQ
Less or equal ( )
Gecode::IntArgs i({1, 2, 3, 4})
std::string expand(Gecode::IntRelType irt)
Expand relation to abbreviation.
Gecode::IntArgs ints({1, 0, 3, 2})
#define GECODE_NEVER
Assert that this command is never executed.