40namespace Test {
namespace Set {
69 if (
x.ints()[0]>=
x.ints()[1] ||
70 x.ints()[1]>=
x.ints()[2])
75 if (xr.
val() !=
x.ints()[0])
80 if (xr.
val() !=
x.ints()[1])
85 if (xr.
val() !=
x.ints()[2])
106 :
SetTest(
t,_ssize,d,false,_isize), ssize(_ssize), isize(_isize) {}
109 for (
int i=0; i<isize; i++) {
110 if (
x.ints()[i] < 0 ||
x.ints()[i] >= ssize)
117 for (
int i=0; i<ssize; i++) {
120 if (csv.val() < 0 || csv.val() >= isize)
return false;
121 if (
x.ints()[csv.val()] != i)
return false;
143 :
SetTest(
t,1,d,false,_isize), isize(_isize) {}
146 for (
int i=0; i<isize; i++) {
147 if (
x.ints()[i] < 0 ||
x.ints()[i] > 1)
152 if (csv.val() < 0 || csv.val() >= isize)
return false;
153 if (
x.ints()[csv.val()] != 1)
return false;
154 for (; cur<csv.val(); cur++)
155 if (
x.ints()[cur] != 0)
return false;
158 for (; cur<isize; cur++)
159 if (
x.ints()[cur] != 0)
return false;
165 for (
int i=
y.size(); i--;)
178 int _x0size, _x1size;
182 :
SetTest(
t,x0size+x1size,d,false), _x0size(x0size), _x1size(x1size) {}
185 for (
int i=0; i<_x0size; i++) {
188 if (x0is.
min() < 0 || x0is.
max() >= _x1size)
190 for (
int j=0; j<_x1size; j++) {
193 if (x1is.
min() < 0 || x1is.
max() >= _x0size)
195 bool jInI = x0is.
in(j);
196 bool iInJ = x1is.
in(i);
struct Gecode::@603::NNF::@65::@66 b
For binary nodes (and, or, eqv)
Node * x
Pointer to corresponding Boolean expression node.
Passing Boolean variables.
int min(int i) const
Return minimum of range at position i.
bool in(int n) const
Return whether n is included in the set.
int max(int i) const
Return maximum of range at position i.
Range iterator for singleton range.
Test for Boolean channel constraint
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.
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
Test for integer channel constraint
virtual void post(Space &home, SetVarArray &x, IntVarArray &y)
Post constraint on x.
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
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
virtual void post(Space &home, SetVarArray &x, IntVarArray &)
Post constraint on x.
Test for sorted channeling constraint
ChannelSorted(const char *t)
Create and register test.
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
virtual void post(Space &home, SetVarArray &x, IntVarArray &y)
Post constraint on x.
Range iterator producing subsets of an IntSet.
Value iterator producing subsets of an IntSet.
int val(void) const
Return current value.
Generate all set assignments.
Base class for tests with set constraints
bool subset(I &i, J &j)
Check whether range iterator i is subset of range iterator j.
Gecode toplevel namespace
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
void channelSorted(Home home, const IntVarArgs &x, SetVar y)
Post propagator for SetVar SetOpType SetVar y
ChannelSet _channelSet33("Channel::Set::3::3", d_12, 2, 3)
ChannelBool _channelbool3("Channel::Bool::3", d4, 5)
ChannelSet _channelSet12("Channel::Set::1::2", d1, 2, 2)
ChannelSet _channelSet22("Channel::Set::2::2", d3, 2, 2)
ChannelBool _channelbool1("Channel::Bool::1", d2, 3)
ChannelSet _channelSet32("Channel::Set::3::2", d_12, 2, 2)
ChannelInt _channelint1("Channel::Int::1", d2, 2, 3)
ChannelInt _channelint2("Channel::Int::2", d3, 3, 3)
ChannelSet _channelSet13("Channel::Set::1::3", d1, 2, 3)
ChannelSet _channelSet23("Channel::Set::2::3", d3, 2, 3)
ChannelBool _channelbool2("Channel::Bool::2", d3, 3)
ChannelSorted _channelSorted("Channel::Sorted")