49 using namespace Channel;
57 if ((xoff < 0) || (yoff < 0))
63 if ((xoff < 2) && (yoff < 2) && (xoff == yoff)) {
65 DomInfo<IntView,NoOffset<IntView> >* di =
66 static_cast<Space&
>(home).
68 for (
int i=n;
i--; ) {
69 di[xoff+
i ].init(x[
i],n+xoff);
70 di[2*xoff+i+
n].init(y[i],n+xoff);
74 di[0].init(x0, n+xoff);
76 di[n+xoff].init(y0, n+xoff);
81 ::
post(home,n+xoff,di,noff,noff)));
84 ::
post(home,n+xoff,di,noff,noff)));
87 ValInfo<IntView>* vi =
88 static_cast<Space&
>(home).alloc<ValInfo<IntView> >(2*(n+xoff));
89 for (
int i=n;
i--; ) {
90 vi[xoff+
i ].init(x[
i],n+xoff);
91 vi[2*xoff+i+
n].init(y[i],n+xoff);
95 vi[0].init(x0, n+xoff);
97 vi[n+xoff].init(y0, n+xoff);
100 if (x.
same(home,y)) {
102 ::
post(home,n+xoff,vi,noff,noff)));
105 ::
post(home,n+xoff,vi,noff,noff)));
110 DomInfo<IntView,Offset>* di =
111 static_cast<Space&
>(home).alloc<DomInfo<IntView,Offset> >(2*n);
112 for (
int i=n;
i--; ) {
114 di[i+
n].init(y[i],n);
118 if (x.
same(home,y)) {
120 ::
post(home,n,di,ox,oy)));
123 ::
post(home,n,di,ox,oy)));
126 ValInfo<IntView>* vi =
127 static_cast<Space&
>(home).alloc<ValInfo<IntView> >(2*n);
128 for (
int i=n;
i--; ) {
130 vi[i+
n].init(y[i],n);
134 if (x.
same(home,y)) {
136 ::
post(home,n,vi,ox,oy)));
139 ::
post(home,n,vi,ox,oy)));
149 channel(home, x, 0, y, 0, icl);
154 if (home.
failed())
return;
165 if (home.
failed())
return;
bool failed(void) const
Check whether corresponding space is failed.
IntConLevel
Consistency levels for integer propagators.
Exception: Value out of limits
void post(Home home, Term *t, int n, FloatRelType frt, FloatVal c)
Post propagator for linear constraint over floats.
static ExecStatus post(Home home, BoolView x0, IntView x1)
Post propagator for .
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
int size(void) const
Return size of array (number of elements)
Converter without offsets.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
Passing integer variables.
static ExecStatus post(Home home, ViewArray< BoolView > &x, IntView y, int o)
Post propagator for .
Passing Boolean variables.
Converter with fixed offset.
Boolean integer variables.
Integer view for integer variables.
Node * x
Pointer to corresponding Boolean expression node.
Exception: Arguments contain same variable multiply
Gecode toplevel namespace
void check(int n, const char *l)
Check whether n is in range, otherwise throw out of limits with information l.
Home class for posting propagators
Exception: Arguments are of different size
#define GECODE_ES_FAIL(es)
Check whether execution status es is failed, and fail space home.
Domain propagation or consistency.
bool same(const Space &home) const
Test whether array contains same variable multiply.