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).
67 alloc<DomInfo<IntView,NoOffset<IntView> > >(2*(
n+xoff));
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);
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);
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);
136 ::
post(home,
n,vi,ox,oy)));
139 ::
post(home,
n,vi,ox,oy)));
IntPropLevel vbd(IntPropLevel ipl)
Extract value, bounds, or domain propagation from propagation level.
Exception: Value out of limits
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)
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
bool same(const VarImpVar< VarImp > &y) const
Test whether variable is the same as y.
Exception: Arguments contain same variable multiply
Domain propagation Preferences: prefer speed or memory.
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.