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=0;
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=0;
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=0;
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=0;
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)));
int n
Number of negative literals for node type.
Node * x
Pointer to corresponding Boolean expression node.
Passing Boolean variables.
Boolean integer variables.
Home class for posting propagators
Passing integer variables.
Exception: Arguments contain same variable multiply
Exception: Arguments are of different size
static ExecStatus post(Home home, ViewArray< BoolView > &x, IntView y, int o)
Post propagator for .
static ExecStatus post(Home home, BoolView x0, IntView x1)
Post propagator for .
Integer view for integer variables.
Converter without offsets.
Converter with fixed offset.
Exception: Value out of limits
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Post propagator for SetVar SetOpType SetVar y
void post(Home home, Term *t, int n, FloatRelType frt, FloatVal c)
Post propagator for linear constraint over floats.
#define GECODE_POST
Check for failure in a constraint post function.
#define GECODE_ES_FAIL(es)
Check whether execution status es is failed, and fail space home.
IntPropLevel
Propagation levels for integer propagators.
@ IPL_DOM
Domain propagation Options: basic versus advanced propagation.
IntPropLevel vbd(IntPropLevel ipl)
Extract value, bounds, or domain propagation from propagation level.
bool same(VarArgArray< Var > x, VarArgArray< Var > y)
void check(int n, const char *l)
Check whether n is in range, otherwise throw out of limits with information l.
Gecode::IntArgs i({1, 2, 3, 4})