Go to the documentation of this file.
40 namespace Gecode {
namespace Set {
namespace Element {
42 template<
class View,
class View0,
class View1>
53 template<
class View,
class View0,
class View1>
58 x0.update(home,share,
p.x0);
59 x1.update(home,share,
p.x1);
63 template<
class View,
class View0,
class View1>
70 template<
class View,
class View0,
class View1>
78 template<
class View,
class View0,
class View1>
91 template<
class View,
class View0,
class View1>
105 template<
class View,
class View0,
class View1>
111 template<
class View,
class View0,
class View1>
145 unsigned int maxCard = 0;
151 if (iv[
i].idx < vx0ub.
val()) {
156 assert(iv[
i].idx == vx0ub.
val());
159 View candidate = iv[j].view;
160 int candidateInd = iv[j].idx;
168 bool selectSingleInconsistent =
false;
169 if (x0.cardMax() <= 1) {
174 selectSingleInconsistent =
175 diff2() || candidate.cardMax() < x1.cardMin();
186 if (selectSingleInconsistent ||
187 candidate.cardMin() > x1.cardMax() ||
189 ModEvent me = (x0.exclude(home,candidateInd));
200 if (vx0() && vx0.
val()==candidateInd) {
203 ModEvent me = x1.includeI(home,candlb);
208 me = candidate.intersectI(home,x1ub);
214 before[j].update(home,sofarBefore);
219 maxCard =
std::max(maxCard, candidate.cardMax());
220 minCard =
std::min(minCard, candidate.cardMin());
229 for (
int k=
i; k<
n; k++) {
235 if (x0.cardMax()==0) {
245 if (x0.cardMin() > 0) {
252 me = x1.cardMin(home, minCard);
258 if (x0.cardMax() <= 1) {
259 ModEvent me = x1.cardMax(home, maxCard);
267 ModEvent me = x1.intersectI(home,sfB);
278 for (
int i=
n;
i--;) {
290 ModEvent me = (x0.include(home,iv[
i].idx));
295 me = iv[
i].view.includeI(home,diff);
309 if (x0.assigned() && !x1.assigned()) {
310 int ubsize =
static_cast<int>(x0.lubSize());
317 ::
post(home(*
this),is,x1)));
318 }
else if (ubsize == 2) {
323 ::
post(home(*
this),
a,
b,x1)));
324 }
else if (ubsize == 1) {
334 bool allAssigned =
true;
335 for (
int i=iv.size();
i--;) {
336 if (!iv[
i].view.assigned()) {
341 if (x1.assigned() && x0.assigned() && allAssigned) {
virtual Actor * copy(Space &home, bool)
Copy propagator during cloning.
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Propagator for ternary union
bool before(const ConstSetView &x, const ConstSetView &y)
ExecStatus ES_SUBSUMED(Propagator &p)
bool includeI(Space &home, I &i)
Include the set represented by i in this set.
An array of IdxView pairs.
bool intersectI(Space &home, I &i)
Exclude all elements not in the set represented by i from this set.
const int min
Smallest allowed integer in integer set.
Gecode::IntArgs i(4, 1, 2, 3, 4)
Propagator for set equality
const FloatNum min
Smallest allowed float value.
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
Base-class for both propagators and branchers.
ElementUnion(Space &home, bool share, ElementUnion &p)
Constructor for cloning p.
int val(void) const
Return current value.
Gecode toplevel namespace
Base-class for propagators.
const int max
Largest allowed integer in integer set.
const unsigned int card
Maximum cardinality of an integer set.
Home class for posting propagators
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
Value iterator from range iterator.
@ AP_DISPOSE
Actor must always be disposed.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Post propagator for SetVar SetOpType SetVar SetRelType r
Range iterator for computing set difference.
Propagator for nary union
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.
Range iterator for the greatest lower bound.
int size(void) const
Return the current size.
int ModEvent
Type for modification events.
void dispose(Space &home)
Free memory used by this set.
Range iterator for computing union (binary)
bool failed(void) const
Check whether space is failed.
virtual void reschedule(Space &home)
Schedule function.
@ ES_FIX
Propagation has computed fixpoint.
Range iterator for the least upper bound.
void subscribe(Space &home, Propagator &p, PropCond pc, bool process=true)
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Range iterator for integer sets.
Growing sets of integers.
const Gecode::PropCond PC_SET_ANY
Propagate when any bound or the cardinality of a view changes.
Range iterator for singleton range.
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
Propagator for element with union
virtual size_t dispose(Space &home)
Delete actor and return its size.
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
Shrinking sets of integers.
int n
Number of negative literals for node type.
int ModEventDelta
Modification event deltas.
static ExecStatus post(Home home, IdxViewArray &x, View0 y, View1 z)
SetExpr inter(const SetVarArgs &x)
Intersection of set variables.
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
@ ES_OK
Execution is okay.
int p
Number of positive literals for node type.
void update(Space &home, bool share, IdxViewArray< View > &x)
Cloning.
const FloatNum max
Largest allowed float value.