39 template<
class VX,
class VY>
48 template<
class VX,
class VY>
56 template<
class VX,
class VY>
62 template<
class VX,
class VY>
68 template<
class VX,
class VY>
75 template<
class VX,
class VY>
85 template<
class VX,
class VY>
96 while ((i < n) && (
x[i].
min() ==
y[i].
max())) {
114 assert(!(
x[i].assigned() &&
y[i].assigned() &&
115 x[i].val() ==
y[i].val()));
117 x.drop_fst(i);
y.drop_fst(i);
133 assert(
x[i].assigned() &&
y[i].assigned() &&
134 (
x[i].val() ==
y[i].val()));
153 x[i-1]=
x[0];
x.drop_fst(i-1);
154 y[i-1]=
y[0];
y.drop_fst(i-1);
168 while ((i < n) && (
x[i].
max() ==
y[i].
min()))
183 for (
int j=i; j<n; j++) {
187 x.size(i);
y.size(i);
204 while ((i < n) && (
x[i].
min() ==
y[i].
max()))
220 for (
int j=i; j<n; j++) {
224 x.size(i);
y.size(i);
239 template<
class VX,
class VY>
243 if (
x.size() <
y.size()) {
245 }
else if (
x.size() >
y.size()) {
264 template<
class VX,
class VY>
273 assert(n ==
y.size());
274 x.size(n-2);
y.size(n-2);
279 template<
class VX,
class VY>
285 template<
class VX,
class VY>
294 template<
class VX,
class VY>
298 x0.update(home,p.
x0);
y0.update(home,p.
y0);
299 x1.update(home,p.
x1);
y1.update(home,p.
y1);
300 x.update(home,p.
x);
y.update(home,p.
y);
303 template<
class VX,
class VY>
313 n--;
x[i]=
x[n];
y[i]=
y[n];
317 n=1;
x[0]=
x[i];
y[0]=
y[i];
325 x.size(n);
y.size(n);
330 template<
class VX,
class VY>
333 if (
x.size() !=
y.size())
342 n--;
x[i]=
x[n];
y[i]=
y[n];
349 n--;
x[i]=
x[n];
y[i]=
y[n];
355 x.size(n);
y.size(n);
365 template<
class VX,
class VY>
371 return sizeof(*this);
374 template<
class VX,
class VY>
379 assert(
x0.assigned() &&
y0.assigned());
380 assert(
x0.val() ==
y0.val());
386 n--;
x[i]=
x[n];
y[i]=
y[n];
393 n--;
x[i]=
x[n];
y[i]=
y[n];
394 x.size(n);
y.size(n);
407 template<
class VX,
class VY>
Base-class for both propagators and branchers.
virtual size_t dispose(Space &home)
Delete actor and return its size.
Home class for posting propagators
static ExecStatus post(Home home, V0 x0, V1 x1)
Post propagator .
virtual size_t dispose(Space &home)
Delete propagator and return its size.
ViewArray< VX > x
View arrays.
static ExecStatus post(Home home, ViewArray< VX > &x, ViewArray< VY > &y, bool strict)
Post propagator for lexical order between x and y.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
LexLqLe(Space &home, LexLqLe< VX, VY > &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual void reschedule(Space &home)
Schedule function.
bool strict
Determines whether propagator is strict or not.
VY y0
View currently subscribed to.
ExecStatus resubscribe(Space &home, RelTest rt, VX &x0, VY &y0, VX x1, VY y1)
Update subscription.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
VX x0
View currently subscribed to.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual void reschedule(Space &home)
Schedule function.
VX x1
View currently subscribed to.
ViewArray< VX > x
Views not yet subscribed to.
LexNq(Home home, ViewArray< VX > &x, ViewArray< VY > &y)
Constructor for posting.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
VY y1
View currently subscribed to.
static ExecStatus post(Home home, ViewArray< VX > &x, ViewArray< VY > &y)
Post propagator .
ViewArray< VY > y
Views not yet subscribed to.
static ExecStatus post(Home home, V0 x0, V1 x1)
Post propagator .
static ExecStatus post(Home home, V0 x0, V1 x1)
Post propagator .
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
static PropCost binary(PropCost::Mod m)
Two variables for modifier pcm.
size_t size
The size of the propagator (used during subsumption)
Propagator(Home home)
Constructor for posting.
ExecStatus ES_SUBSUMED(Propagator &p)
Propagator p is subsumed
int ModEventDelta
Modification event deltas.
bool failed(void) const
Check whether space is failed.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
Simple relation propagators.
const Gecode::PropCond PC_INT_VAL
Propagate when a view becomes assigned (single value)
RelTest rtest_eq_dom(VX x, VY y)
Test whether views x and y are equal (use full domain information)
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
RelTest rtest_eq_bnd(VX x, VY y)
Test whether views x and y are equal (use bounds information)
RelTest
Result of testing relation.
@ RT_TRUE
Relation does hold.
@ RT_MAYBE
Relation may hold or not.
@ RT_FALSE
Relation does not hold.
Gecode toplevel namespace
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
@ ES_OK
Execution is okay.
@ ES_FIX
Propagation has computed fixpoint.
@ ES_FAILED
Execution has resulted in failure.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
#define GECODE_NEVER
Assert that this command is never executed.