56 dsv(new
Gecode::IntSetValues[static_cast<unsigned int>(
n)]) {
66 assert((i>=0) && (i<
n));
77 unsigned int skip = rand(
d.size());
79 if (it.width() > skip)
80 return it.min() +
static_cast<int>(skip);
100 assert((i>=0) && (i<
n));
110 unsigned int skip = rand(
d.size());
112 if (it.width() > skip)
113 return it.min() +
static_cast<int>(skip);
125 for (
int i=n0; i--; )
127 for (
int i=n1; i--; )
138 assert((i>=0) && (i<
n));
187 int a,
int min,
int max,
bool r,
212 case IPL_VAL: s <<
"Val";
break;
213 case IPL_BND: s <<
"Bnd";
break;
214 case IPL_DOM: s <<
"Dom";
break;
215 default: s <<
"Def";
break;
276 case IRT_EQ:
return x == y;
277 case IRT_NQ:
return x != y;
278 case IRT_LQ:
return x <= y;
279 case IRT_LE:
return x < y;
280 case IRT_GR:
return x > y;
281 case IRT_GQ:
return x >= y;
Passing integer arguments.
Range iterator for integer sets.
Base(std::string s)
Create and register test with name s.
static std::string str(bool b)
Map bool to string.
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.
Gecode::IntSetValues * dsv
Iterator for each variable.
virtual bool has_more(void) const
Test whether all assignments have been iterated.
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.
IntPropLevels(void)
Initialize iterator.
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.
int a
How many assignments still to be generated Generate new value according to domain.
int * vals
The current values for the variables.
RandomAssignment(int n, const Gecode::IntSet &d, int a0, Gecode::Support::RandomGenerator &rand)
Initialize for a assignments for n0 variables and values d0.
int randval(Gecode::Support::RandomGenerator &rand)
virtual bool has_more(void) const
Test whether all assignments have been iterated.
int _n1
How many variables in the second set.
int randval(const Gecode::IntSet &d, Gecode::Support::RandomGenerator &rand)
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 has_more(void) const
Test whether all assignments have been iterated.
RandomMixAssignment(int n0, const Gecode::IntSet &d0, int n1, const Gecode::IntSet &d1, int a0, Gecode::Support::RandomGenerator &rand)
Initialize for a assignments for n0 variables and values d0.
virtual ~RandomMixAssignment(void)
Destructor.
int a
How many assignments still to be generated.
int * vals
The current values for the variables.
bool pmi(void) const
Test whether reverse implication as reification mode is supported.
bool reified
Does the constraint also exist as reified constraint.
bool testsearch
Whether to perform search test.
static std::string str(bool b)
Map bool to string.
bool testfix
Whether to perform fixpoint test.
int rms
Which reification modes are supported.
Test(const std::string &p, const std::string &s, int a, const Gecode::IntSet &d, bool r=false, Gecode::IntPropLevel i=Gecode::IPL_DEF)
Constructor.
Gecode::IntPropLevel ipl
Propagation level.
bool eqv(void) const
Test whether equivalence as reification mode is supported.
int arity
Number of variables.
static bool cmp(T x, Gecode::IntRelType r, T y)
Compare x and y with respect to r.
Gecode::IntSet dom
Domain of variables.
bool imp(void) const
Test whether implication as reification mode is supported.
ConTestLevel contest
Whether to test for certain consistency.
LinearCongruentialGenerator< 2147483647, 48271, 44488, 3399 > RandomGenerator
Default values for linear congruential generator.
IntRelType
Relation types for integers.
BoolOpType
Operation types for Booleans.
IntPropLevel
Propagation levels for integer propagators.
@ IRT_GQ
Greater or equal ( ).
@ IRT_LQ
Less or equal ( ).
@ RM_IMP
Implication for reification.
@ RM_PMI
Inverse implication for reification.
@ RM_EQV
Equivalence for reification (default).
@ IPL_BASIC
Use basic propagation algorithm.
@ IPL_DOM
Domain propagation Options: basic versus advanced propagation.
@ IPL_VAL
Value propagation.
@ IPL_ADVANCED
Use advanced propagation algorithm.
@ IPL_BND
Bounds propagation.
Gecode toplevel namespace
IntPropLevel vbd(IntPropLevel ipl)
Extract value, bounds, or domain propagation from propagation level.
Testing finite domain integers.
@ CTL_NONE
No consistency-test.
@ CTL_DOMAIN
Test for domain-consistency.
#define GECODE_NEVER
Assert that this command is never executed.