44 namespace Test {
namespace Set {
110 :
SetTest(t,_ssize,d,false,_isize), ssize(_ssize), isize(_isize) {}
113 for (
int i=0;
i<isize;
i++) {
121 for (
int i=0;
i<ssize;
i++) {
124 if (
csv.val() < 0 ||
csv.val() >= isize)
return false;
125 if (x.
ints()[
csv.val()] !=
i)
return false;
147 :
SetTest(t,1,d,false,_isize), isize(_isize) {}
150 for (
int i=0;
i<isize;
i++) {
156 if (
csv.val() < 0 ||
csv.val() >= isize)
return false;
157 if (x.
ints()[
csv.val()] != 1)
return false;
158 for (; cur<
csv.val(); cur++)
159 if (x.
ints()[cur] != 0)
return false;
162 for (; cur<isize; cur++)
163 if (x.
ints()[cur] != 0)
return false;
169 for (
int i=y.
size();
i--;)
182 int _x0size, _x1size;
186 :
SetTest(t,x0size+x1size,d,false), _x0size(x0size), _x1size(x1size) {}
189 for (
int i=0;
i<_x0size;
i++) {
192 if (x0is.
min() < 0 || x0is.
max() >= _x1size)
194 for (
int j=0; j<_x1size; j++) {
197 if (x1is.
min() < 0 || x1is.
max() >= _x0size)
199 bool jInI = x0is.
in(j);
200 bool iInJ = x1is.
in(i);
Test for Boolean channel constraint
virtual void post(Space &home, SetVarArray &x, IntVarArray &y)
Post constraint on x.
void channelSorted(Home home, const IntVarArgs &x, SetVar y)
Post propagator for and .
Range iterator for singleton range.
virtual void post(Space &home, SetVarArray &x, IntVarArray &)
Post constraint on x.
ChannelSet _channelSet33("Channel::Set::3::3", d_12, 2, 3)
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
bool in(int n) const
Return whether n is included in the set.
ChannelSorted _channelSorted("Channel::Sorted")
ChannelInt _channelint2("Channel::Int::2", d3, 3, 3)
ChannelInt _channelint1("Channel::Int::1", d2, 2, 3)
ChannelSorted(const char *t)
Create and register test.
virtual void post(Space &home, SetVarArray &x, IntVarArray &y)
Post constraint on x.
ChannelSet _channelSet32("Channel::Set::3::2", d_12, 2, 2)
ChannelSet _channelSet22("Channel::Set::2::2", d3, 2, 2)
ChannelShared csv(Gecode::ICL_VAL)
ChannelSet _channelSet23("Channel::Set::2::3", d3, 2, 3)
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
Gecode::IntArgs i(4, 1, 2, 3, 4)
ChannelSet _channelSet13("Channel::Set::1::3", d1, 2, 3)
virtual void post(Space &home, SetVarArray &x, IntVarArray &y)
Post constraint on x.
const Test::Int::Assignment & ints(void) const
Return assignment for integer variables.
unsigned int size(I &i)
Size of all ranges of range iterator i.
Gecode::IntSet lub
The common superset for all domains.
ChannelBool _channelbool2("Channel::Bool::2", d3, 3)
struct Gecode::@512::NNF::@54::@55 b
For binary nodes (and, or, eqv)
int val(void) const
Return current value.
Value iterator producing subsets of an IntSet.
Passing Boolean variables.
int size(void) const
Return size of array (number of elements)
Node * x
Pointer to corresponding Boolean expression node.
Base class for tests with set constraints
Generate all set assignments.
ChannelInt(const char *t, const IntSet &d, int _ssize, int _isize)
Create and register test.
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
Range iterator producing subsets of an IntSet.
Test for sorted channeling constraint
ChannelSet _channelSet12("Channel::Set::1::2", d1, 2, 2)
bool subset(I &i, J &j)
Check whether range iterator i is subset of range iterator j.
Gecode toplevel namespace
ChannelBool(const char *t, const IntSet &d, int _isize)
Create and register test.
ChannelBool _channelbool1("Channel::Bool::1", d2, 3)
ArrayTraits< VarArgArray< Var > >::ArgsType slice(int start, int inc=1, int n=-1)
Test for integer channel constraint
ChannelBool _channelbool3("Channel::Bool::3", d4, 5)
Test for set channel constraint
ChannelSet(const char *t, const IntSet &d, int x0size, int x1size)
Create and register test.
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
int max(int i) const
Return maximum of range at position i.
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
int min(int i) const
Return minimum of range at position i.