Go to the documentation of this file.
44 namespace Test {
namespace Set {
73 if (
x.ints()[0]>=
x.ints()[1] ||
74 x.ints()[1]>=
x.ints()[2])
79 if (xr.
val() !=
x.ints()[0])
84 if (xr.
val() !=
x.ints()[1])
89 if (xr.
val() !=
x.ints()[2])
110 :
SetTest(
t,_ssize,
d,false,_isize), ssize(_ssize), isize(_isize) {}
113 for (
int i=0;
i<isize;
i++) {
114 if (
x.ints()[
i] < 0 ||
x.ints()[
i] >= ssize)
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++) {
151 if (
x.ints()[
i] < 0 ||
x.ints()[
i] > 1)
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);
ChannelInt(const char *t, const IntSet &d, int _ssize, int _isize)
Create and register test.
Post propagator for SetVar x
ChannelSorted _channelSorted("Channel::Sorted")
Post propagator for SetVar SetOpType SetVar y
bool in(int n) const
Return whether n is included in the set.
int min(int i) const
Return minimum of range at position i.
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
int max(int i) const
Return maximum of range at position i.
ChannelSet _channelSet13("Channel::Set::1::3", d1, 2, 3)
virtual void post(Space &home, SetVarArray &x, IntVarArray &y)
Post constraint on x.
ChannelSet _channelSet12("Channel::Set::1::2", d1, 2, 2)
Test for Boolean channel constraint
unsigned int size(I &i)
Size of all ranges of range iterator i.
int val(void) const
Return current value.
void channelSorted(Home home, const IntVarArgs &x, SetVar y)
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
Gecode::IntArgs i(4, 1, 2, 3, 4)
ChannelBool _channelbool2("Channel::Bool::2", d3, 3)
ChannelSet _channelSet22("Channel::Set::2::2", d3, 2, 2)
bool subset(I &i, J &j)
Check whether range iterator i is subset of range iterator j.
ChannelSet _channelSet32("Channel::Set::3::2", d_12, 2, 2)
Generate all set assignments.
virtual void post(Space &home, SetVarArray &x, IntVarArray &y)
Post constraint on x.
Gecode toplevel namespace
ChannelSet _channelSet33("Channel::Set::3::3", d_12, 2, 3)
Passing Boolean variables.
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
ChannelSet _channelSet23("Channel::Set::2::3", d3, 2, 3)
Value iterator producing subsets of an IntSet.
Base class for tests with set constraints
ChannelInt _channelint1("Channel::Int::1", d2, 2, 3)
ChannelInt _channelint2("Channel::Int::2", d3, 3, 3)
ChannelSorted(const char *t)
Create and register test.
ChannelShared csv(Gecode::IPL_VAL)
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
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Test for integer channel constraint
Test for set channel constraint
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
Range iterator producing subsets of an IntSet.
Test for sorted channeling constraint
Range iterator for singleton range.
ChannelBool _channelbool3("Channel::Bool::3", d4, 5)
virtual void post(Space &home, SetVarArray &x, IntVarArray &)
Post constraint on x.
ChannelBool _channelbool1("Channel::Bool::1", d2, 3)
virtual void post(Space &home, SetVarArray &x, IntVarArray &y)
Post constraint on x.
ChannelBool(const char *t, const IntSet &d, int _isize)
Create and register test.