Go to the documentation of this file.
39 namespace Test {
namespace Int {
58 :
Test(
"Element::Int::Int::Var::"+s,2,
min,
max),
62 return (
x[0]>= 0) && (
x[0]<
c.
size()) &&
c[
x[0]]==
x[1];
80 :
Test(
"Element::Int::Int::Int::"+s+
"::"+
str(r0),1,-4,8),
84 return (
x[0]>= 0) && (
x[0]<
c.
size()) &&
c[
x[0]]==
r;
101 :
Test(
"Element::Int::Int::Shared::"+s,1,minDomain,8),
c(c0) {}
104 return (
x[0]>= 0) && (
x[0]<
c.
size()) &&
c[
x[0]]==
x[0];
120 :
Test(
"Element::Int::Bool::Var::"+s,2,-4,8),
c(c0) {}
123 return (
x[0]>= 0) && (
x[0]<
c.
size()) &&
c[
x[0]]==
x[1];
141 :
Test(
"Element::Int::Bool::Int::"+s+
"::"+
str(r0),1,-4,8),
145 return (
x[0]>= 0) && (
x[0]<
c.
size()) &&
c[
x[0]]==
r;
158 :
Test(
"Element::Var::Int::Var::"+
str(
ipl),6,-1,3,false,
ipl) {}
161 return (
x[0]>= 0) && (
x[0]<
x.size()-2) &&
x[2+
x[0]]==
x[1];
166 for (
int i=0;
i<
x.size()-2;
i++)
181 5,-1,3,false,
ipl),
r(r0) {
186 return (
x[0]>= 0) && (
x[0]<
x.size()-1) &&
x[1+
x[0]]==
r;
191 for (
int i=0;
i<
x.size()-1;
i++)
202 :
Test(
"Element::Var::Int::Shared::"+
str(
ipl),5,-1,3,false,
ipl) {
207 return (
x[0]>= 0) && (
x[0]<
x.size()-1) &&
x[1+
x[0]]==
x[0];
212 for (
int i=0;
i<
x.size()-1;
i++)
225 for (
int i=0;
i<
x.size()-2;
i++)
226 if ((
x[2+
i] < 0) || (
x[2+
i]>1))
228 return ((
x[0]>= 0) && (
x[0]<
x.size()-2) &&
x[2+
x[0]]==
x[1]
229 && (
x[1]>=0) && (
x[1]<=1));
235 for (
int i=0;
i<
x.size()-2;
i++)
249 :
Test(
"Element::Var::Bool::Int::"+
str(r0),5,-1,3,false),
r(r0) {}
252 for (
int i=0;
i<
x.size()-1;
i++)
253 if ((
x[1+
i] < 0) || (
x[1+
i]>1))
255 return ((
x[0]>= 0) && (
x[0]<
x.size()-1) &&
x[1+
x[0]]==
r);
261 for (
int i=0;
i<
x.size()-1;
i++)
294 :
Test(
"Element::Matrix::Int::IntVar::XY",3,0,5,false),
300 if ((
x[0] > 2) || (
x[1] > 1))
303 return m(
x[0],
x[1]) ==
x[2];
322 :
Test(
"Element::Matrix::Int::IntVar::XX",2,0,3,false),
331 return m(
x[0],
x[0]) ==
x[1];
350 :
Test(
"Element::Matrix::Int::BoolVar::XY",3,0,3,false),
356 if ((
x[0] > 1) || (
x[1] > 1))
359 return m(
x[0],
x[1]) ==
x[2];
378 :
Test(
"Element::Matrix::Int::BoolVar::XX",2,0,3,false),
387 return m(
x[0],
x[0]) ==
x[1];
403 :
Test(
"Element::Matrix::IntVar::IntVar::XY",3+4,0,3,false) {}
409 if ((
x[0] > 1) || (
x[1] > 1))
412 tm[0]=
x[3]; tm[1]=
x[4]; tm[2]=
x[5]; tm[3]=
x[6];
414 return m(
x[0],
x[1]) ==
x[2];
421 tm[0]=
x[3]; tm[1]=
x[4]; tm[2]=
x[5]; tm[3]=
x[6];
432 :
Test(
"Element::Matrix::IntVar::IntVar::XX",2+4,0,3,false) {}
441 tm[0]=
x[2]; tm[1]=
x[3]; tm[2]=
x[4]; tm[3]=
x[5];
443 return m(
x[0],
x[0]) ==
x[1];
450 tm[0]=
x[2]; tm[1]=
x[3]; tm[2]=
x[4]; tm[3]=
x[5];
461 :
Test(
"Element::Matrix::BoolVar::BoolVar::XY",3+4,0,1,false) {}
468 tm[0]=
x[3]; tm[1]=
x[4]; tm[2]=
x[5]; tm[3]=
x[6];
470 return m(
x[0],
x[1]) ==
x[2];
489 :
Test(
"Element::Matrix::BoolVar::BoolVar::XX",2+4,0,1,false) {}
496 tm[0]=
x[2]; tm[1]=
x[3]; tm[2]=
x[4]; tm[3]=
x[5];
498 return m(
x[0],
x[0]) ==
x[1];
521 for (
int i=0;
i<idx;
i++)
533 IntArgs ic2({-1,1,-1,1,-1,1,0,0});
535 IntArgs ic4({0,-1,2,-2,4,-3,6});
539 IntArgs bc2({1,1,0,1,0,1,0,0});
550 SCHAR_MAX-1,SCHAR_MAX,
554 for (
int i=0; ov[
i] != 0;
i++)
555 for (
int j=0; ov[j] != 0; j++)
556 optimized(ov[
i],ov[j]);
559 for (
int i=-4;
i<=4;
i++) {
576 for (
int i=0;
i<=1;
i++) {
585 for (
int i=-4;
i<=4;
i++) {
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
ConTestLevel contest
Whether to test for certain consistency.
MatrixIntVarIntVarXX(void)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Gecode::IntArgs c
Array of integers.
Test for element with integer array and integer and Boolean variable
Gecode::IntPropLevel ipl
Propagation level.
Test for matrix element with integer array and Boolean variable
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
void optimized(int idx, int val)
Test size-dependent optimizations
Passing integer variables.
void element(Home home, IntSharedArray c, IntVar x0, IntVar x1, IntPropLevel)
Post domain consistent propagator for .
VarBoolInt(int r0)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Test for matrix element with Boolean variable array and Boolean variable
Test for element with variable array and shared integer variable
Test for matrix element with integer array and integer variable
const FloatNum min
Smallest allowed float value.
Help class to create and register tests.
virtual bool solution(const Assignment &x) const
Test whether x is solution
IntPropLevel
Propagation levels for integer propagators.
virtual bool solution(const Assignment &x) const
Test whether x is solution
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 for element with integer array and integer variables
static Gecode::Support::RandomGenerator rand
Random number generator.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
MatrixBoolVarBoolVarXX(void)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Test for element with variable array and integer variables
Test for element with integer array and single shared integer variable
Gecode::IntArgs tm
Array for test matrix.
VarIntInt(Gecode::IntPropLevel ipl, int r0)
Create and register test.
Gecode toplevel namespace
MatrixIntIntVarXY(void)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Node * x
Pointer to corresponding Boolean expression node.
Test for element with Boolean variable array and integer variable
Test for element with integer array and integer and Boolean variable
Test for matrix element with integer variable array and integer variable
virtual bool solution(const Assignment &x) const
Test whether x is solution
Passing Boolean variables.
virtual bool solution(const Assignment &x) const
Test whether x is solution
IntBoolVar(const std::string &s, const Gecode::IntArgs &c0)
Create and register test.
Gecode::IntArgs c
Array of integers.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Boolean integer variables.
Gecode::IntArgs c
Array of integers.
Domain propagation Options: basic versus advanced propagation.
virtual bool solution(const Assignment &x) const
Test whether x is solution
IntBoolInt(const std::string &s, const Gecode::IntArgs &c0, int r0)
Create and register test.
bool one(const Gecode::FloatValArgs &a)
Check whether has only one coefficients.
Test for matrix element with Boolean variable array and Boolean variable
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.
IntIntInt(const std::string &s, const Gecode::IntArgs &c0, int r0)
Create and register test.
#define GECODE_NEVER
Assert that this command is never executed.
Gecode::IntArgs tm
Array for test matrix.
MatrixIntVarIntVarXY(void)
Create and register test.
IntIntVar(const std::string &s, const Gecode::IntArgs &c0, int min, int max)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Matrix-interface for arrays.
MatrixIntBoolVarXY(void)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Gecode::IntArgs c
Array of integers.
VarIntShared(Gecode::IntPropLevel ipl)
Create and register test.
Base class for assignments
void element(Home home, const SetVarArgs &a, IntVar x, int w, IntVar y, int h, SetVar z)
VarBoolVar(void)
Create and register test.
MatrixIntIntVarXX(void)
Create and register test.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
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
int size(void) const
Return size of array (number of elements)
Gecode::IntArgs tm
Array for test matrix.
virtual bool solution(const Assignment &x) const
Test whether x is solution
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
IntIntShared(const std::string &s, const Gecode::IntArgs &c0, int minDomain=-4)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Test for element with integer array and integer variables
Gecode::IntArgs c
Array of integers.
Test for matrix element with integer variable array and integer variable
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 &x)
Post constraint on x.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Test for element with variable array and integer variables
Test for matrix element with integer array and integer variable
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
VarIntVar(Gecode::IntPropLevel ipl)
Create and register test.
Test for matrix element with integer array and Boolean variable
Passing integer arguments.
Gecode::IntArgs i({1, 2, 3, 4})
MatrixIntBoolVarXX(void)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Gecode::IntArgs tm
Array for test matrix.
Test for element with Boolean variable array and integer variable
virtual bool solution(const Assignment &x) const
Test whether x is solution
Create(void)
Perform creation and registration.
const FloatNum max
Largest allowed float value.
virtual bool solution(const Assignment &x) const
Test whether x is solution
MatrixBoolVarBoolVarXY(void)
Create and register test.
static std::string str(Gecode::IntPropLevel ipl)
Map integer propagation level to string.