36namespace Test {
namespace Int {
56 dsv(new
Gecode::IntSetValues[static_cast<unsigned int>(
n)]) {
66 assert((i>=0) && (i<
n));
79 if (it.width() > skip)
80 return it.min() +
static_cast<int>(skip);
89 :
Assignment(
n,d), vals(new int[static_cast<size_t>(
n)]),
a(a0) {
100 assert((i>=0) && (i<
n));
112 if (it.width() > skip)
113 return it.min() +
static_cast<int>(skip);
124 :
Assignment(n0+n1,d0),vals(new int[static_cast<size_t>(n0+n1)]),
125 a(a0),_n1(n1),_d1(d1) {
126 for (
int i=n0; i--; )
128 for (
int i=n1; i--; )
139 assert((i>=0) && (i<
n));
157 Test::imp(
void)
const {
161 Test::pmi(
void)
const {
165 Test::Test(
const std::string&
p,
const std::string& s,
168 :
Base(
p+s), arity(
a), dom(d),
169 reified(
r), rms((1 <<
Gecode::RM_EQV) |
173 testsearch(true), testfix(true) {}
176 Test::Test(
const std::string& s,
179 :
Base(
"Int::"+s), arity(
a), dom(d),
180 reified(
r), rms((1 <<
Gecode::RM_EQV) |
184 testsearch(true), testfix(true) {}
187 Test::Test(
const std::string&
p,
const std::string& s,
188 int a,
int min,
int max,
bool r,
190 :
Base(
p+s), arity(
a), dom(min,max),
191 reified(
r), rms((1 <<
Gecode::RM_EQV) |
195 testsearch(true), testfix(true) {}
198 Test::Test(
const std::string& s,
200 :
Base(
"Int::"+s), arity(
a), dom(min,max),
201 reified(
r), rms((1 <<
Gecode::RM_EQV) |
205 testsearch(true), testfix(true) {}
213 case IPL_VAL: s <<
"Val";
break;
214 case IPL_BND: s <<
"Bnd";
break;
215 case IPL_DOM: s <<
"Dom";
break;
216 default: s <<
"Def";
break;
218 if (ipl & IPL_BASIC) s <<
"+B";
219 if (ipl & IPL_ADVANCED) s <<
"+A";
228 case IRT_LQ:
return "Lq";
229 case IRT_LE:
return "Le";
230 case IRT_GQ:
return "Gq";
231 case IRT_GR:
return "Gr";
232 case IRT_EQ:
return "Eq";
233 case IRT_NQ:
return "Nq";
244 case BOT_AND:
return "And";
245 case BOT_OR:
return "Or";
246 case BOT_IMP:
return "Imp";
247 case BOT_EQV:
return "Eqv";
248 case BOT_XOR:
return "Xor";
278 for (
int i=0; i<
x.
size()-1; i++)
279 s += str(
x[i]) +
",";
280 return "[" + s + str(
x[
x.size()-1]) +
"]";
288 case IRT_EQ:
return x == y;
289 case IRT_NQ:
return x != y;
290 case IRT_LQ:
return x <= y;
291 case IRT_LE:
return x < y;
292 case IRT_GR:
return x > y;
293 case IRT_GQ:
return x >= y;
302 IntPropLevels::IntPropLevels(
void)
struct Gecode::@603::NNF::@65::@66 b
For binary nodes (and, or, eqv)
int p
Number of positive literals for node type.
int n
Number of negative literals for node type.
struct Gecode::@603::NNF::@65::@67 a
For atomic nodes.
Node * x
Pointer to corresponding Boolean expression node.
int size(void) const
Return size of array (number of elements)
Passing integer arguments.
Range iterator for integer sets.
void init(const IntSet &s)
Initialize with values for s.
unsigned int size(void) const
Return size (cardinality) of set.
int val(void) const
Return current value.
Base class for all tests to be run
static Gecode::Support::RandomGenerator rand
Random number generator.
Base class for assignments
Gecode::IntSet d
Domain for each variable.
int n
Number of variables.
virtual ~Assignment(void)
Destructor.
Assignment(int n0, const Gecode::IntSet &d0)
Initialize assignments for n0 variables and values d0.
int size(void) const
Return number of variables.
BoolOpTypes(void)
Initialize iterator.
bool operator()(void) const
Test whether iterator is done.
Gecode::BoolOpType bot(void) const
Return current operation type.
void operator++(void)
Increment to next operation type.
CpltAssignment(int n, const Gecode::IntSet &d)
Initialize assignments for n0 variables and values d0.
virtual int operator[](int i) const
Return value for variable i.
virtual ~CpltAssignment(void)
Destructor.
virtual bool operator()(void) const
Test whether all assignments have been iterated.
Gecode::IntSetValues * dsv
Iterator for each variable.
Gecode::IntPropLevel ipl(void) const
Return current level.
bool operator()(void) const
Test whether iterator is done.
IntPropBasicAdvanced(void)
Initialize iterator.
void operator++(void)
Increment to next level.
Gecode::IntPropLevel ipl(void) const
Return current level.
bool operator()(void) const
Test whether iterator is done.
void operator++(void)
Increment to next level.
void operator++(void)
Increment to next relation type.
bool operator()(void) const
Test whether iterator is done.
void reset(void)
Reset iterator.
IntRelTypes(void)
Initialize iterator.
Gecode::IntRelType irt(void) const
Return current relation type.
virtual int operator[](int i) const
Return value for variable i.
virtual ~RandomAssignment(void)
Destructor.
RandomAssignment(int n, const Gecode::IntSet &d, int a)
Initialize for a assignments for n0 variables and values d0.
int a
How many assigments still to be generated Generate new value according to domain.
int * vals
The current values for the variables.
virtual bool operator()(void) const
Test whether all assignments have been iterated.
RandomMixAssignment(int n0, const Gecode::IntSet &d0, int n1, const Gecode::IntSet &d1, int a0)
Initialize for a assignments for n0 variables and values d0.
Gecode::IntSet _d1
Domain for second set of variables Generate new value according to domain d.
virtual int operator[](int i) const
Return value for variable i.
virtual bool operator()(void) const
Test whether all assignments have been iterated.
virtual ~RandomMixAssignment(void)
Destructor.
int a
How many assigments still to be generated.
int * vals
The current values for the variables.
int randval(const Gecode::IntSet &d)
bool eqv(void) const
Test whether equivalence as reification mode is supported.
IntRelType
Relation types for integers.
BoolOpType
Operation types for Booleans.
IntPropLevel
Propagation levels for integer propagators.
@ RM_IMP
Implication for reification.
@ RM_PMI
Inverse implication for reification.
@ RM_EQV
Equivalence for reification (default)
Gecode toplevel namespace
@ CTL_NONE
No consistency-test.
@ CTL_DOMAIN
Test for domain-consistency.
#define GECODE_NEVER
Assert that this command is never executed.