38 namespace Gecode {
namespace Int {
namespace Rel {
43 template<
class VX,
class VY>
52 template<
class VX,
class VY>
60 template<
class VX,
class VY>
66 template<
class VX,
class VY>
72 template<
class VX,
class VY>
79 template<
class VX,
class VY>
89 template<
class VX,
class VY>
100 while ((i < n) && (
x[i].
min() ==
y[i].
max())) {
119 x[i].val() ==
y[i].val()));
138 (
x[i].val() ==
y[i].val()));
172 while ((i < n) && (
x[i].
max() ==
y[i].
min()))
187 for (
int j=i; j<
n; j++) {
208 while ((i < n) && (
x[i].
min() ==
y[i].
max()))
224 for (
int j=i; j<
n; j++) {
243 template<
class VX,
class VY>
268 template<
class VX,
class VY>
272 x0(xv[xv.
size()-2]), y0(yv[xv.
size()-2]),
273 x1(xv[xv.
size()-1]), y1(yv[xv.
size()-1]),
277 assert(n ==
y.
size());
283 template<
class VX,
class VY>
289 template<
class VX,
class VY>
298 template<
class VX,
class VY>
302 x0.update(home,p.
x0);
y0.update(home,p.
y0);
303 x1.update(home,p.
x1);
y1.update(home,p.
y1);
307 template<
class VX,
class VY>
321 n=1;
x[0]=
x[
i];
y[0]=
y[
i];
334 template<
class VX,
class VY>
346 n--; x[
i]=x[
n]; y[
i]=y[
n];
351 if (
same(x[i],y[i])) {
353 n--; x[
i]=x[
n]; y[
i]=y[
n];
369 template<
class VX,
class VY>
375 return sizeof(*this);
378 template<
class VX,
class VY>
383 assert(x0.assigned() && y0.assigned());
384 assert(x0.val() == y0.val());
411 template<
class VX,
class VY>
VX x1
View currently subscribed to.
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
Relation may hold or not.
void reschedule(Space &home, Propagator &p, PropCond pc)
Re-schedule propagator p with propagation condition pc.
static ExecStatus post(Home home, V0 x0, V1 x1)
Post propagator .
VX x0
View currently subscribed to.
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
void update(Space &home, ViewArray< View > &a)
Update array to be a clone of array a.
ExecStatus ES_SUBSUMED(Propagator &p)
virtual size_t dispose(Space &home)
Delete propagator and return its size.
RelTest rtest_eq_dom(VX x, VY y)
Test whether views x and y are equal (use full domain information)
static ExecStatus post(Home home, V0 x0, V1 x1)
Post propagator .
ViewArray< VX > x
Views not yet subscribed to.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
LexLqLe(Space &home, LexLqLe< VX, VY > &p)
Constructor for cloning p.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
VY y1
View currently subscribed to.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
Base-class for propagators.
Lexical disequality propagator.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
void subscribe(Space &home, Propagator &p, PropCond pc, bool schedule=true)
Subscribe propagator p with propagation condition pc to variable.
Propagation has computed fixpoint.
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.
bool same(const CachedView< View > &x, const CachedView< View > &y)
int p
Number of positive literals for node type.
static ExecStatus post(Home home, ViewArray< VX > &x, ViewArray< VY > &y)
Post propagator .
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Execution has resulted in failure.
RelTest
Result of testing relation.
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
virtual void reschedule(Space &home)
Schedule function.
bool failed(void) const
Check whether space is failed.
Less or equal propagator.
size_t size
The size of the propagator (used during subsumption)
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
void drop_fst(int i)
Drop views from positions 0 to i-1 from array.
void cancel(Space &home, Propagator &p, PropCond pc)
Cancel subscription of propagator p with propagation condition pc to all views.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
ViewArray< VY > y
Views not yet subscribed to.
LexNq(Home home, ViewArray< VX > &x, ViewArray< VY > &y)
Constructor for posting.
ExecStatus resubscribe(Space &home, RelTest rt, VX &x0, VY &y0, VX x1, VY y1)
Update subscription.
RelTest rtest_eq_bnd(VX x, VY y)
Test whether views x and y are equal (use bounds information)
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Post propagator for SetVar SetOpType SetVar y
static ExecStatus post(Home home, ViewArray< VX > &x, ViewArray< VY > &y, bool strict)
Post propagator for lexical order between x and y.
virtual void reschedule(Space &home)
Schedule function.
Lexical ordering propagator.
static ExecStatus post(Home home, V0 x0, V1 x1)
Post 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.
bool strict
Determines whether propagator is strict or not.
Binary disequality propagator.
Post propagator for SetVar x
ViewArray< VX > x
View arrays.
Gecode toplevel namespace
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
int size(void) const
Return size of array (number of elements)
int ModEventDelta
Modification event deltas.
Home class for posting propagators
static PropCost binary(PropCost::Mod m)
Two variables for modifier pcm.
VY y0
View currently subscribed to.
#define GECODE_NEVER
Assert that this command is never executed.
const Gecode::PropCond PC_INT_VAL
Propagate when a view becomes assigned (single value)