38 namespace Gecode {
namespace Int {
namespace Rel {
56 x.update(home,share,p.
x);
57 y.update(home,share,p.
y);
93 while ((i < n) && (
x[i].
min() == y[i].
max())) {
112 x[i].val() == y[i].val()));
114 x.drop_fst(i); y.drop_fst(i);
131 (
x[i].val() == y[i].val()));
150 x[i-1]=
x[0];
x.drop_fst(i-1);
151 y[i-1]=y[0]; y.drop_fst(i-1);
155 if (
x[1].
max() <= y[1].
min()) {
165 while ((i < n) && (
x[i].
max() == y[i].
min()))
180 for (
int j=i; j<
n; j++) {
184 x.size(i); y.size(i);
191 if (
x[1].
min() >= y[1].
max()) {
201 while ((i < n) && (
x[i].
min() == y[i].
max()))
217 for (
int j=i; j<
n; j++) {
221 x.size(i); y.size(i);
265 x0(xv[xv.
size()-2]), y0(yv[xv.
size()-2]),
266 x1(xv[xv.
size()-1]), y1(yv[xv.
size()-1]),
270 assert(n ==
y.size());
271 x.size(n-2);
y.size(n-2);
286 x0.update(home,share,p.
x0);
y0.update(home,share,p.
y0);
287 x1.update(home,share,p.
x1);
y1.update(home,share,p.
y1);
288 x.update(home,share,p.
x);
y.update(home,share,p.
y);
332 n--; x[
i]=x[
n]; y[
i]=y[
n];
337 if (
same(x[i],y[i])) {
339 n--; x[
i]=x[
n]; y[
i]=y[
n];
351 (void)
new (home)
LexNq(home,x,y);
361 return sizeof(*this);
367 RelTest rt, View& x0, View& y0, View x1, View y1) {
369 assert(x0.assigned() && y0.assigned());
370 assert(x0.val() == y0.val());
376 n--;
x[
i]=
x[
n]; y[
i]=y[
n];
383 n--;
x[
i]=
x[
n]; y[
i]=y[
n];
384 x.size(n); y.size(n);
LexLqLe(Space &home, bool share, LexLqLe< View > &p)
Constructor for cloning p.
View x0
Views currently subscribed to.
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
Relation may hold or not.
static ExecStatus post(Home home, ViewArray< View > &x, ViewArray< View > &y)
Post propagator .
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
ExecStatus ES_SUBSUMED(Propagator &p)
ExecStatus resubscribe(Space &home, Propagator &p, VX &x0, ViewArray< VX > &x, VY &x1, ViewArray< VY > &y)
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Base-class for propagators.
Lexical disequality propagator.
Propagation has computed fixpoint.
ExecStatus resubscribe(Space &home, RelTest rt, View &x0, View &y0, View x1, View y1)
Update subscription.
static ExecStatus post(Home home, View x0, View x1)
Post propagator .
virtual size_t dispose(Space &home)
Delete propagator and return its size.
bool failed(void) const
Check whether space is failed.
Base-class for both propagators and branchers.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
LexNq(Home home, ViewArray< View > &x, ViewArray< View > &y)
Constructor for posting.
ViewArray< View > x
View arrays.
bool same(const CachedView< View > &x, const CachedView< View > &y)
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Execution has resulted in failure.
RelTest
Result of testing relation.
static ExecStatus post(Home home, ViewArray< View > &x, ViewArray< View > &y, bool strict)
Post propagator for lexical order between x and y.
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
unsigned int size(I &i)
Size of all ranges of range iterator i.
Less or equal propagator.
static ExecStatus post(Home home, View x0, View x1)
Post propagator .
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Node * x
Pointer to corresponding Boolean expression node.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
Lexical ordering propagator.
virtual size_t dispose(Space &home)
Delete actor and return its size.
bool assigned(View x, int v)
Whether x is assigned to value v.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Binary disequality propagator.
RelTest rtest_eq_bnd(View x, View y)
Test whether views x and y are equal (use bounds information)
int size(void) const
Return size of array (number of elements)
ViewArray< View > x
Views not yet subscribed to.
Gecode toplevel namespace
static ExecStatus post(Home home, View x0, View x1)
Post propagator .
int ModEventDelta
Modification event deltas.
Home class for posting propagators
static PropCost binary(PropCost::Mod m)
Two variables for modifier pcm.
#define GECODE_NEVER
Assert that this command is never executed.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
const Gecode::PropCond PC_INT_VAL
Propagate when a view becomes assigned (single value)