34namespace Gecode {
namespace Int {
namespace Rel {
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()) {
244 y.size(
x.size()); strict=
false;
245 }
else if (
x.size() >
y.size()) {
246 x.size(
y.size()); strict=
true;
264 template<
class VX,
class VY>
268 x0(xv[xv.size()-2]), y0(yv[xv.size()-2]),
269 x1(xv[xv.size()-1]), y1(yv[xv.size()-1]),
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);
303 template<
class VX,
class VY>
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())
355 x.size(
n);
y.size(
n);
365 template<
class VX,
class VY>
371 return sizeof(*this);
374 template<
class VX,
class VY>
377 RelTest rt, VX& x0, VY& y0, VX x1, VY y1) {
379 assert(x0.assigned() && y0.assigned());
380 assert(x0.val() == y0.val());
394 x.size(
n);
y.size(
n);
407 template<
class VX,
class VY>
int p
Number of positive literals for node type.
int n
Number of negative literals for node type.
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 .
Lexical ordering 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.
Lexical disequality propagator.
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.
Less or equal propagator.
static ExecStatus post(Home home, V0 x0, V1 x1)
Post propagator .
Binary disequality 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.
Base-class for propagators.
void update(Space &home, ViewArray< View > &a)
Update array to be a clone of array a.
void subscribe(Space &home, Propagator &p, PropCond pc, bool schedule=true)
Subscribe propagator p with propagation condition pc to variable.
int size(void) const
Return size of array (number of elements)
ExecStatus ES_SUBSUMED(Propagator &p)
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.
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 .
Post propagator for SetVar SetOpType SetVar y
@ 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 .
Post propagator for SetVar x
#define GECODE_NEVER
Assert that this command is never executed.