38 namespace Gecode {
namespace Int {
namespace Rel {
45 template<
class View0,
class View1>
50 template<
class View0,
class View1>
55 }
else if (x1.assigned()) {
57 }
else if (!
same(x0,x1)) {
67 template<
class View0,
class View1>
72 template<
class View0,
class View1>
79 template<
class View0,
class View1>
85 template<
class View0,
class View1>
90 }
else if (x1.assigned()) {
96 }
while (x0.min() != x1.min());
100 }
while (x0.max() != x1.max());
104 assert(x0.assigned() && x1.assigned());
113 template<
class View0,
class View1>
118 template<
class View0,
class View1>
123 }
else if (x1.assigned()) {
125 }
else if (!
same(x0,x1)) {
136 template<
class View0,
class View1>
141 template<
class View0,
class View1>
148 template<
class View0,
class View1>
154 template<
class View0,
class View1>
165 template<
class View0,
class View1>
180 }
while (x0.min() != x1.min());
184 }
while (x0.max() != x1.max());
187 if (x0.range() && x1.range())
218 }
else if (x.
size() > 2) {
221 for (
int i=x.
size();
i-- > 1; ) {
225 for (
int i=x.
size();
i--; ) {
258 assert(
x.size() > 2);
263 for (
int i = 0; ;
i++)
267 for (
int j =
x.size(); j--; )
279 for (
int i =
x.size();
i--; ) {
281 if (mn <
x[
i].
min()) {
291 for (
int i =
x.size();
i--; ) {
293 if (mx >
x[
i].
max()) {
308 for (
int i = n;
i--; ) {
319 for (
int i = n;
i--; ) {
324 for (
int i = n;
i--; ) {
350 }
else if (x.
size() > 2) {
353 for (
int i=x.
size();
i-- > 1; ) {
357 for (
int i=x.
size();
i--; ) {
389 assert(
x.size() > 2);
392 for (
int i = 0; ;
i++)
396 for (
int j =
x.size(); j--; )
405 for (
int i =
x.size();
i--; ) {
407 if (mn <
x[
i].
min()) {
414 for (
int i =
x.size();
i--; ) {
416 if (mx >
x[
i].
max()) {
431 template<
class View,
class CtrlView, ReifyMode rm>
436 template<
class View,
class CtrlView, ReifyMode rm>
450 (void)
new (home)
ReEqDom(home,x0,x1,b);
451 }
else if (rm !=
RM_IMP) {
458 template<
class View,
class CtrlView, ReifyMode rm>
463 template<
class View,
class CtrlView, ReifyMode rm>
469 template<
class View,
class CtrlView, ReifyMode rm>
505 template<
class View,
class CtrlView, ReifyMode rm>
510 template<
class View,
class CtrlView, ReifyMode rm>
524 (void)
new (home)
ReEqBnd(home,x0,x1,b);
525 }
else if (rm !=
RM_IMP) {
532 template<
class View,
class CtrlView, ReifyMode rm>
537 template<
class View,
class CtrlView, ReifyMode rm>
543 template<
class View,
class CtrlView, ReifyMode rm>
580 template<
class View,
class CtrlView, ReifyMode rm>
586 template<
class View,
class CtrlView, ReifyMode rm>
592 }
else if (b.zero()) {
595 }
else if (x.assigned()) {
611 template<
class View,
class CtrlView, ReifyMode rm>
617 template<
class View,
class CtrlView, ReifyMode rm>
623 template<
class View,
class CtrlView, ReifyMode rm>
629 }
else if (b.zero()) {
658 template<
class View,
class CtrlView, ReifyMode rm>
661 (
Home home, View x,
int c0, CtrlView b)
664 template<
class View,
class CtrlView, ReifyMode rm>
670 }
else if (b.zero()) {
673 }
else if (x.assigned()) {
689 template<
class View,
class CtrlView, ReifyMode rm>
694 template<
class View,
class CtrlView, ReifyMode rm>
700 template<
class View,
class CtrlView, ReifyMode rm>
706 }
else if (b.zero()) {
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
Relation may hold or not.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
ReEqDomInt(Space &home, bool share, ReEqDomInt &p)
Constructor for cloning p.
Inverse implication for reification.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
static ExecStatus post(Home home, ViewArray< View > &x)
Post bounds consistent propagator .
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
Binary domain consistent equality propagator.
ExecStatus ES_SUBSUMED(Propagator &p)
const FloatNum max
Largest allowed float value.
int min(void) const
Return smallest value of range.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Reified binary propagator.
static ExecStatus post(Home home, View0 x0, View1 x1)
Post domain consistent propagator .
int ModEvent
Type for modification events.
Base-class for propagators.
NaryEqDom(Space &home, bool share, NaryEqDom< View > &p)
Constructor for cloning p.
n-ary domain consistent equality propagator
Propagation has computed fixpoint.
static PropCost unary(PropCost::Mod m)
Single variable for modifier pcm.
static ExecStatus post(Home home, View x, int c, CtrlView b)
Post bounds consistent propagator .
void unique(const Space &home)
Remove all duplicate views from array (changes element order)
static ExecStatus post(Home home, View x0, View x1, CtrlView b)
Post bounds consistent propagator .
Base-class for both propagators and branchers.
EqBnd(Space &home, bool share, EqBnd< View0, View1 > &p)
Constructor for cloning p.
Range iterator for integer views.
static ExecStatus post(Home home, View0 x0, View1 x1)
Post bounds consistent propagator .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
bool same(const CachedView< View > &x, const CachedView< View > &y)
Gecode::FloatVal c(-8, 8)
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
int p
Number of positive literals for node type.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
const FloatNum min
Smallest allowed float value.
Gecode::IntArgs i(4, 1, 2, 3, 4)
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
int n
Number of negative literals for node type.
void reset(void)
Reset iterator to start.
Execution has resulted in failure.
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
const Gecode::ModEvent ME_INT_VAL
Domain operation has resulted in a value (assigned variable)
Reified binary domain consistent equality propagator.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
ReEqBndInt(Space &home, bool share, ReEqBndInt &p)
Constructor for cloning p.
Binary bounds consistent equality propagator.
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
const Gecode::ModEvent ME_INT_BND
Domain operation has changed the minimum or maximum of the domain.
Reified binary bounds consistent equality propagator.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
EqDom(Space &home, bool share, EqDom< View0, View1 > &p)
Constructor for cloning p.
static ExecStatus post(Home home, View x0, View x1, CtrlView b)
Post domain consistent propagator .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
RelTest rtest_eq_dom(View x, View y)
Test whether views x and y are equal (use full domain information)
ExecStatus ES_FIX_PARTIAL(Propagator &p, const ModEventDelta &med)
Propagator p has computed partial fixpoint
static ExecStatus post(Home home, View x, int c, CtrlView b)
Post domain consistent propagator .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Reified bounds consistent equality with integer propagator.
union Gecode::@518::NNF::@57 u
Union depending on nodetype t.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Node * x
Pointer to corresponding Boolean expression node.
Range iterator for intersection of iterators.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
const Gecode::ModEvent ME_INT_DOM
Domain operation has changed the domain.
bool assigned(View x, int v)
Whether x is assigned to value v.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
int max(void) const
Return largest value of range.
Binary disequality propagator.
RelTest rtest_eq_bnd(View x, View y)
Test whether views x and y are equal (use bounds information)
NaryEqBnd(Space &home, bool share, NaryEqBnd< View > &p)
Constructor for cloning p.
n-ary bounds consistent equality propagator
bool shared(const ConstView< ViewA > &, const ConstView< ViewB > &)
Test whether views share same variable.
int size(void) const
Return size of array (number of elements)
ReEqBnd(Space &home, bool share, ReEqBnd &p)
Constructor for cloning p.
struct Gecode::@518::NNF::@57::@58 b
For binary nodes (and, or, eqv)
Gecode toplevel namespace
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Implication for reification.
static ExecStatus post(Home home, ViewArray< View > &x)
Post domain consistent propagator .
static ExecStatus post(Home home, View x0, View x1)
Post propagator .
int ModEventDelta
Modification event deltas.
Reified domain consistent equality with integer propagator.
Home class for posting propagators
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
static PropCost binary(PropCost::Mod m)
Two variables for modifier pcm.
#define GECODE_NEVER
Assert that this command is never executed.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
ReEqDom(Space &home, bool share, ReEqDom &p)
Constructor for cloning p.