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)) {
63 template<
class View0,
class View1>
68 template<
class View0,
class View1>
75 template<
class View0,
class View1>
81 template<
class View0,
class View1>
87 template<
class View0,
class View1>
93 assert(
x1.assigned());
105 template<
class View0,
class View1>
110 template<
class View0,
class View1>
115 }
else if (x1.assigned()) {
117 }
else if (!
same(x0,x1)) {
127 template<
class View0,
class View1>
132 template<
class View0,
class View1>
139 template<
class View0,
class View1>
145 template<
class View0,
class View1>
150 }
else if (
x1.assigned()) {
156 }
while (
x0.min() !=
x1.min());
160 }
while (
x0.max() !=
x1.max());
164 assert(
x0.assigned() &&
x1.assigned());
173 template<
class View0,
class View1>
178 template<
class View0,
class View1>
183 }
else if (x1.assigned()) {
185 }
else if (!
same(x0,x1)) {
196 template<
class View0,
class View1>
201 template<
class View0,
class View1>
208 template<
class View0,
class View1>
214 template<
class View0,
class View1>
225 template<
class View0,
class View1>
240 }
while (
x0.min() !=
x1.min());
244 }
while (
x0.max() !=
x1.max());
247 if (
x0.range() &&
x1.range())
278 }
else if (x.
size() > 2) {
281 for (
int i=x.
size();
i-- > 1; ) {
285 for (
int i=x.
size();
i--; ) {
318 assert(
x.size() > 2);
323 for (
int i = 0; ;
i++)
327 for (
int j =
x.size(); j--; )
339 for (
int i =
x.size();
i--; ) {
341 if (mn <
x[
i].
min()) {
351 for (
int i =
x.size();
i--; ) {
353 if (mx >
x[
i].
max()) {
368 for (
int i = n;
i--; ) {
379 for (
int i = n;
i--; ) {
384 for (
int i = n;
i--; ) {
410 }
else if (x.
size() > 2) {
413 for (
int i=x.
size();
i-- > 1; ) {
417 for (
int i=x.
size();
i--; ) {
449 assert(
x.size() > 2);
452 for (
int i = 0; ;
i++)
456 for (
int j =
x.size(); j--; )
465 for (
int i =
x.size();
i--; ) {
467 if (mn <
x[
i].
min()) {
474 for (
int i =
x.size();
i--; ) {
476 if (mx >
x[
i].
max()) {
491 template<
class View,
class CtrlView, ReifyMode rm>
496 template<
class View,
class CtrlView, ReifyMode rm>
510 (void)
new (home)
ReEqDom(home,x0,x1,b);
511 }
else if (rm !=
RM_IMP) {
518 template<
class View,
class CtrlView, ReifyMode rm>
523 template<
class View,
class CtrlView, ReifyMode rm>
529 template<
class View,
class CtrlView, ReifyMode rm>
565 template<
class View,
class CtrlView, ReifyMode rm>
570 template<
class View,
class CtrlView, ReifyMode rm>
584 (void)
new (home)
ReEqBnd(home,x0,x1,b);
585 }
else if (rm !=
RM_IMP) {
592 template<
class View,
class CtrlView, ReifyMode rm>
597 template<
class View,
class CtrlView, ReifyMode rm>
603 template<
class View,
class CtrlView, ReifyMode rm>
640 template<
class View,
class CtrlView, ReifyMode rm>
646 template<
class View,
class CtrlView, ReifyMode rm>
652 }
else if (b.zero()) {
655 }
else if (x.assigned()) {
671 template<
class View,
class CtrlView, ReifyMode rm>
677 template<
class View,
class CtrlView, ReifyMode rm>
683 template<
class View,
class CtrlView, ReifyMode rm>
689 }
else if (b.zero()) {
718 template<
class View,
class CtrlView, ReifyMode rm>
721 (
Home home, View x,
int c0, CtrlView b)
724 template<
class View,
class CtrlView, ReifyMode rm>
730 }
else if (b.zero()) {
733 }
else if (x.assigned()) {
749 template<
class View,
class CtrlView, ReifyMode rm>
754 template<
class View,
class CtrlView, ReifyMode rm>
760 template<
class View,
class CtrlView, ReifyMode rm>
766 }
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.
int c
Integer constant to check.
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.
View0 x0
View of type View0.
RelTest rtest_eq_dom(VX x, VY y)
Test whether views x and y are equal (use full domain information)
Binary value propagation equality propagator.
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.
ViewArray< View > x
Array of views.
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.
View1 x1
View of type View1.
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 .
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
CtrlView b
Boolean control view.
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.
int c
Integer constant to check.
int max(void) const
Return largest value of range.
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.
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.
EqVal(Space &home, bool share, EqVal< View0, View1 > &p)
Constructor for cloning p.
union Gecode::@554::NNF::@60 u
Union depending on nodetype t.
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.
ModEventDelta med
A set of modification events (used during 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.
static ExecStatus post(Home home, View0 x0, View1 x1)
Post value propagation propagator .
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
int min(void) const
Return smallest value of range.
ExecStatus ES_FIX_PARTIAL(Propagator &p, const ModEventDelta &med)
Propagator p has computed partial fixpoint
RelTest rtest_eq_bnd(VX x, VY y)
Test whether views x and y are equal (use bounds information)
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.
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.
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.
Binary disequality propagator.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
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.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
ReEqBnd(Space &home, bool share, ReEqBnd &p)
Constructor for cloning p.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function: low unary.
Gecode toplevel namespace
Implication for reification.
CtrlView b
Boolean control view.
static ExecStatus post(Home home, ViewArray< View > &x)
Post domain consistent propagator .
static ExecStatus post(Home home, View x0, View x1)
Post propagator .
struct Gecode::@554::NNF::@60::@61 b
For binary nodes (and, or, eqv)
int size(void) const
Return size of array (number of elements)
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.
const Gecode::PropCond PC_INT_VAL
Propagate when a view becomes assigned (single value)
ReEqDom(Space &home, bool share, ReEqDom &p)
Constructor for cloning p.