42 namespace Test {
namespace Int {
45 namespace MiniModelCount {
64 class IntInt :
public Test {
72 :
Test(
"MiniModel::"+
expand(irt0)+
"::Int::Int",4,-2,2), irt(irt0) {}
76 for (
int i=x.
size();
i--; )
103 :
Test(
"MiniModel::"+
expand(irt0)+
"::Int::Var",5,-2,2), irt(irt0) {}
107 for (
int i=0;
i<4;
i++)
110 return cmp(m,irt,x[4]);
115 for (
int i=0;
i<4;
i++)
137 :
Test(
"MiniModel::"+
expand(irt0)+
"::Var::Var",5,-2,2), irt(irt0) {}
141 for (
int i=0;
i<3;
i++)
144 return cmp(m,irt,x[4]);
149 for (
int i=0;
i<3;
i++)
171 :
Test(
"MiniModel::"+
expand(irt0)+
"::Var::Int",4,-2,2), irt(irt0) {}
175 for (
int i=0;
i<3;
i++)
183 for (
int i=0;
i<3;
i++)
207 :
Test(
"MiniModel::"+
expand(irt0)+
"::IntArray::Int",5,-2,2),
212 for (
int i=0;
i<4;
i++)
220 for (
int i=0;
i<4;
i++)
242 :
Test(
"MiniModel::"+
expand(irt0)+
"::IntArray::Var",5,-2,2),
247 for (
int i=0;
i<4;
i++)
250 return cmp(m,irt,x[4]);
255 for (
int i=0;
i<4;
i++)
278 (void)
new IntInt(irts.irt());
279 (void)
new IntVar(irts.irt());
280 (void)
new VarVar(irts.irt());
281 (void)
new VarInt(irts.irt());
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Test number of several equal integers equal to integer
Gecode::IntRelType irt
Integer relation type to propagate.
Gecode::IntRelType irt
Integer relation type to propagate.
static bool cmp(T x, Gecode::IntRelType r, T y)
Compare x and y with respect to r.
virtual bool solution(const Assignment &x) const
Test whether x is solution
void atmost(Home home, const IntVarArgs &x, int n, int m, IntConLevel icl=ICL_DEF)
Post constraint .
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
IntVar(Gecode::IntRelType irt0)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Gecode::IntRelType irt
Integer relation type to propagate.
Test number of equal integers equal to 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
void atleast(Home home, const IntVarArgs &x, int n, int m, IntConLevel icl=ICL_DEF)
Post constraint .
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
std::string expand(Gecode::IntRelType irt)
Expand relation to abbreviation.
Gecode::IntArgs ints(4, 1, 0, 3, 2)
virtual bool solution(const Assignment &x) const
Test whether x is solution
Gecode::IntArgs i(4, 1, 2, 3, 4)
IntInt(Gecode::IntRelType irt0)
Create and register test.
VarInt(Gecode::IntRelType irt0)
Create and register test.
Gecode::IntRelType irt
Integer relation type to propagate.
IntRelType
Relation types for integers.
Iterator for integer relation types.
Create(void)
Perform creation and registration.
Passing integer variables.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Passing integer arguments.
void exactly(Home home, const IntVarArgs &x, int n, int m, IntConLevel icl=ICL_DEF)
Post constraint .
Gecode::IntRelType irt
Integer relation type to propagate.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Test number of several equal integers equal to integer variable
Node * x
Pointer to corresponding Boolean expression node.
Test number of equal variables equal to integer
Help class to create and register tests.
Base class for assignments
IntArrayInt(Gecode::IntRelType irt0)
Create and register test.
VarVar(Gecode::IntRelType irt0)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
virtual bool solution(const Assignment &x) const
Test whether x is solution
Test number of equal variables equal to integer variable
#define GECODE_NEVER
Assert that this command is never executed.
int size(void) const
Return number of variables.
IntArrayVar(Gecode::IntRelType irt0)
Create and register test.
Gecode::IntRelType irt
Integer relation type to propagate.
Test number of equal integers equal to integer