Go to the documentation of this file.
36 namespace Gecode {
namespace Set {
namespace Element {
38 template<
class View,
class View0,
class View1>
49 template<
class View,
class View0,
class View1>
59 template<
class View,
class View0,
class View1>
66 template<
class View,
class View0,
class View1>
74 template<
class View,
class View0,
class View1>
87 template<
class View,
class View0,
class View1>
101 template<
class View,
class View0,
class View1>
107 template<
class View,
class View0,
class View1>
141 unsigned int maxCard = 0;
147 if (iv[
i].idx < vx0ub.
val()) {
152 assert(iv[
i].idx == vx0ub.
val());
155 View candidate = iv[j].view;
156 int candidateInd = iv[j].idx;
164 bool selectSingleInconsistent =
false;
165 if (x0.cardMax() <= 1) {
170 selectSingleInconsistent =
171 diff2() || candidate.cardMax() < x1.cardMin();
182 if (selectSingleInconsistent ||
183 candidate.cardMin() > x1.cardMax() ||
185 ModEvent me = (x0.exclude(home,candidateInd));
196 if (vx0() && vx0.
val()==candidateInd) {
199 ModEvent me = x1.includeI(home,candlb);
204 me = candidate.intersectI(home,x1ub);
210 before[j].
update(home,sofarBefore);
215 maxCard =
std::max(maxCard, candidate.cardMax());
216 minCard =
std::min(minCard, candidate.cardMin());
225 for (
int k=
i; k<
n; k++) {
231 if (x0.cardMax()==0) {
237 before[
i].dispose(home);
241 if (x0.cardMin() > 0) {
248 me = x1.cardMin(home, minCard);
254 if (x0.cardMax() <= 1) {
255 ModEvent me = x1.cardMax(home, maxCard);
263 ModEvent me = x1.intersectI(home,sfB);
274 for (
int i=
n;
i--;) {
286 ModEvent me = (x0.include(home,iv[
i].idx));
291 me = iv[
i].view.includeI(home,diff);
305 if (x0.assigned() && !x1.assigned()) {
306 int ubsize =
static_cast<int>(x0.lubSize());
313 ::
post(home(*
this),is,x1)));
314 }
else if (ubsize == 2) {
319 ::
post(home(*
this),
a,
b,x1)));
320 }
else if (ubsize == 1) {
330 for (
int i=iv.size();
i--;)
331 if (!iv[
i].view.assigned())
333 if (!x1.assigned() || !x0.assigned())
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
ElementUnion(Space &home, ElementUnion &p)
Constructor for cloning p.
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.
void update(Space &home, IdxViewArray< View > &x)
Cloning.
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.
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.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Home class for posting propagators
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
void update(Space &home, BndSet &x)
Update this set to be a clone of set x.
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
Range iterator for the greatest lower bound.
int size(void) const
Return the current size.
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
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)
Gecode::IntArgs i({1, 2, 3, 4})
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.
const FloatNum max
Largest allowed float value.