45 using namespace Channel;
53 if ((xoff < 0) || (yoff < 0))
59 if ((xoff < 2) && (yoff < 2) && (xoff == yoff)) {
61 DomInfo<IntView,NoOffset<IntView> >* di =
62 static_cast<Space&
>(home).
64 for (
int i=n;
i--; ) {
65 di[xoff+
i ].init(x[
i],n+xoff);
66 di[2*xoff+i+
n].init(y[i],n+xoff);
70 di[0].init(x0, n+xoff);
72 di[n+xoff].init(y0, n+xoff);
77 ::
post(home,n+xoff,di,noff,noff)));
80 ::
post(home,n+xoff,di,noff,noff)));
83 ValInfo<IntView>* vi =
84 static_cast<Space&
>(home).alloc<ValInfo<IntView> >(2*(n+xoff));
85 for (
int i=n;
i--; ) {
86 vi[xoff+
i ].init(x[
i],n+xoff);
87 vi[2*xoff+i+
n].init(y[i],n+xoff);
91 vi[0].init(x0, n+xoff);
93 vi[n+xoff].init(y0, n+xoff);
98 ::
post(home,n+xoff,vi,noff,noff)));
101 ::
post(home,n+xoff,vi,noff,noff)));
106 DomInfo<IntView,Offset>* di =
107 static_cast<Space&
>(home).alloc<DomInfo<IntView,Offset> >(2*n);
108 for (
int i=n;
i--; ) {
110 di[i+
n].init(y[i],n);
116 ::
post(home,n,di,ox,oy)));
119 ::
post(home,n,di,ox,oy)));
122 ValInfo<IntView>* vi =
123 static_cast<Space&
>(home).alloc<ValInfo<IntView> >(2*n);
124 for (
int i=n;
i--; ) {
126 vi[i+
n].init(y[i],n);
132 ::
post(home,n,vi,ox,oy)));
135 ::
post(home,n,vi,ox,oy)));
145 channel(home, x, 0, y, 0, ipl);
IntPropLevel vbd(IntPropLevel ipl)
Extract value, bounds, or domain propagation from propagation level.
Exception: Value out of limits
int size(void) const
Return size of array (number of elements)
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 .
Converter without offsets.
Gecode::IntArgs i(4, 1, 2, 3, 4)
bool same(void) const
Test whether array contains same variable multiply.
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.
IntPropLevel
Propagation levels for integer propagators.
Integer view for integer variables.
Post propagator for SetVar SetOpType SetVar y
Exception: Arguments contain same variable multiply
Domain propagation Options: basic versus advanced propagation.
Post propagator for SetVar x
Gecode toplevel namespace
#define GECODE_POST
Check for failure in a constraint post function.
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.
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.