43 template<
class View0,
class View1>
48 template<
class View0,
class View1>
53 }
else if (
x1.assigned()) {
55 }
else if (
x0 !=
x1) {
65 template<
class View0,
class View1>
70 template<
class View0,
class View1>
77 template<
class View0,
class View1>
83 template<
class View0,
class View1>
88 }
else if (
x1.assigned()) {
94 }
while (
x0.min() !=
x1.min());
98 }
while (
x0.max() !=
x1.max());
102 assert(
x0.assigned() &&
x1.assigned());
123 }
else if (
x.size() > 2) {
126 for (
int i=
x.size(); i-- > 1; ) {
127 l = std::max(l,
x[i].
min());
128 u = std::min(u,
x[i].
max());
130 for (
int i=
x.size(); i--; ) {
162 assert(
x.size() > 2);
165 for (
int i = 0; ; i++)
166 if (
x[i].assigned()) {
169 for (
int j =
x.size(); j--; )
178 for (
int i =
x.size(); i--; ) {
180 if (mn <
x[i].
min()) {
187 for (
int i =
x.size(); i--; ) {
189 if (mx >
x[i].
max()) {
204 template<
class View,
class CtrlView, ReifyMode rm>
209 template<
class View,
class CtrlView, ReifyMode rm>
224 }
else if (rm !=
RM_IMP) {
231 template<
class View,
class CtrlView, ReifyMode rm>
236 template<
class View,
class CtrlView, ReifyMode rm>
242 template<
class View,
class CtrlView, ReifyMode rm>
277 template<
class View,
class CtrlView, ReifyMode rm>
283 template<
class View,
class CtrlView, ReifyMode rm>
289 }
else if (
x.assigned()) {
304 template<
class View,
class CtrlView, ReifyMode rm>
309 template<
class View,
class CtrlView, ReifyMode rm>
315 template<
class View,
class CtrlView, ReifyMode rm>
Base-class for both propagators and branchers.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Eq(Space &home, Eq< View0, View1 > &p)
Constructor for cloning p.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
static ExecStatus post(Home home, View0 x0, View1 x1)
Post bounds consistent propagator .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
NaryEq(Space &home, NaryEq< View > &p)
Constructor for cloning p.
static ExecStatus post(Home home, ViewArray< View > &x)
Post bounds consistent propagator .
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
static ExecStatus post(Home home, View0 x0, View1 x1)
Post bounds consistent propagator .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
FloatVal c
Float constant to check.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
static ExecStatus post(Home home, View x, FloatVal c, CtrlView b)
Post bounds consistent propagator .
ReEqFloat(Space &home, ReEqFloat &p)
Constructor for cloning p.
ReEq(Space &home, ReEq &p)
Constructor for cloning p.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
static ExecStatus post(Home home, View x0, View x1, CtrlView b)
Post bounds consistent propagator .
Home class for posting propagators
ReBinaryPropagator(Space &home, ReBinaryPropagator &p)
ReUnaryPropagator(Space &home, ReUnaryPropagator &p)
MixBinaryPropagator(Space &home, MixBinaryPropagator &p)
NaryPropagator(Space &home, NaryPropagator &p)
static PropCost unary(PropCost::Mod m)
Single variable for modifier pcm.
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
ModEventDelta med
A set of modification events (used during propagation)
Propagator(Home home)
Constructor for posting.
ExecStatus ES_SUBSUMED(Propagator &p)
Propagator p is subsumed
int ModEventDelta
Modification event deltas.
#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.
double FloatNum
Floating point number base type.
@ RM_IMP
Implication for reification.
@ RM_PMI
Inverse implication for reification.
Simple relation propagators.
@ RT_TRUE
Relation does hold.
@ RT_FALSE
Relation does not hold.
@ RT_MAYBE
Relation may hold or not.
const Gecode::ModEvent ME_FLOAT_VAL
Domain operation has resulted in a value (assigned variable)
RelTest rtest_eq(View x, View y)
Test whether views x and y are equal.
bool overlap(const FloatVal &x, const FloatVal &y)
const Gecode::PropCond PC_FLOAT_BND
Propagate when minimum or maximum of a view changes.
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.
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.