Go to the documentation of this file.
44 namespace Test {
namespace Int {
59 :
Test(
"GCC::Int::All::MinMax::"+
str(
ipl),4,-1,3,false,
ipl) {}
65 for (
int i=
x.size();
i--; )
80 for (
int i=0;
i<5;
i++) {
93 :
Test(
"GCC::Int::All::MinMaxDef::"+
str(
ipl),4,0,3,false,
ipl) {}
99 for (
int i=
x.size();
i--; )
113 for (
int i=0;
i<4;
i++) {
126 :
Test(
"GCC::Int::All::Max::"+
str(
ipl), 4, 1,2, false,
ipl) {}
132 for (
int i=
x.size();
i--; )
134 if (
n[0] != 2 ||
n[1] != 2)
152 :
Test(std::string(
"GCC::Int::Some::")+
153 (hole ?
"::Hole" :
"::Full")+
str(
ipl),4,1,4,false,
ipl) {}
159 for (
int i=
x.size();
i--; )
161 if ((
n[0] < 2) || (
n[1] < 2) || (
n[2] > 0) || (
n[3] > 0))
177 cards[0]=fixed; cards[1]=fixed;
186 static const int n = 4;
195 for (
int i=0;
i<
n;
i++)
196 if ((
x[
i] < 0) || (
x[
i] > 2))
198 int*
card =
new int[m];
199 for (
int i=0;
i<m;
i++) {
201 if ((
x[
n+
i] < 0) || (
x[
n+
i] > 2)) {
206 for (
int i=0;
i<
n;
i++)
208 for (
int i=0;
i<m;
i++)
223 for (
int i=0;
i<
n;
i++)
225 for (
int i=0;
i<m;
i++)
237 static const int randomArity = 7;
247 if (
arity>randomArity)
254 int*
card =
new int[m];
255 for (
int i=0;
i<m;
i++) {
257 if ((
x[
n+
i] < 0) || (
x[
n+
i] >
n)) {
262 for (
int i=0;
i<
n;
i++)
264 for (
int i=0;
i<m;
i++)
274 if (
arity > randomArity)
285 for (
int i=0;
i<
n;
i++)
287 for (
int i=0;
i<m;
i++)
307 (void)
new VarAll(ipls.ipl());
308 (void)
new VarSome(
"Small",2,-1,3,ipls.ipl());
309 (void)
new VarSome(
"Large",3,-1,4,ipls.ipl());
void values(Home home, const IntVarArgs &x, IntSet y, IntPropLevel ipl=IPL_DEF)
Post constraint .
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Post propagator for SetVar SetOpType SetVar y
bool testsearch
Whether to perform search test.
ConTestLevel contest
Whether to test for certain consistency.
int min(int i) const
Return minimum of range at position i.
Test for integer cardinality with min and max for all variables
Test for variable cardinality for all cardinality values
VarAll(Gecode::IntPropLevel ipl)
Create and register test.
VarSome(std::string s, int n0, int min, int max, Gecode::IntPropLevel ipl)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &xy)
Post constraint on xy.
Test for integer cardinality with min and max for all variables
Gecode::IntPropLevel ipl
Propagation level.
Generate random selection of assignments.
int n
Number of non-cardinality variables.
Passing integer variables.
virtual bool solution(const Assignment &x) const
Test whether x is solution
IntAllMinMaxDef(Gecode::IntPropLevel ipl)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
@ CTL_NONE
No consistency-test.
Gecode::IntArgs i(4, 1, 2, 3, 4)
Test for integer cardinality for some variables
const FloatNum min
Smallest allowed float value.
IntPropLevel
Propagation levels for integer propagators.
Test for variable cardinality for some cardinality values
Create(void)
Perform creation and registration.
int size(void) const
Return size of array (number of elements)
Test for integer cardinality with max cardinality for all variables
Gecode toplevel namespace
virtual Assignment * assignment(void) const
Create and register initial assignment.
const unsigned int card
Maximum cardinality of an integer set.
Node * x
Pointer to corresponding Boolean expression node.
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
virtual void post(Gecode::Space &home, Gecode::IntVarArray &xy)
Post constraint on xy.
virtual bool solution(const Assignment &x) const
Test whether x is solution
virtual bool solution(const Assignment &x) const
Test whether x is solution
IntSome(Gecode::IntPropLevel ipl)
Create and register test.
IntAllMax(Gecode::IntPropLevel ipl)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Iterator for simple integer propagation levels.
int arity
Number of variables.
Generate all assignments.
Base class for assignments
void count(Home home, const IntVarArgs &x, int n, IntRelType irt, int m, IntPropLevel)
Post propagator for .
IntAllMinMax(Gecode::IntPropLevel ipl)
Create and register test.
Help class to create and register tests.
int n
Number of negative literals for node type.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Passing integer arguments.
const FloatNum max
Largest allowed float value.
void count(Home home, const IntVarArgs &x, const IntSet &c, const IntArgs &v, IntPropLevel ipl)
Posts a global count (cardinality) constraint.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Gecode::IntSet dom
Domain of variables.
static std::string str(Gecode::IntPropLevel ipl)
Map integer propagation level to string.