Go to the documentation of this file.
40 namespace Gecode {
namespace Set {
namespace Element {
42 template<
class SView,
class RView>
53 for (
unsigned int i=iv0.size();
i--;)
57 template<
class SView,
class RView>
63 x0.update(home,share,
p.x0);
64 x1.update(home,share,
p.x1);
66 for (
unsigned int i=
n_iv;
i--;)
67 iv[
i].update(home,share,
p.iv[
i]);
70 template<
class SView,
class RView>
76 template<
class SView,
class RView>
83 template<
class SView,
class RView>
91 for (
unsigned int i=n_iv;
i--;)
97 template<
class SView,
class RView>
112 template<
class SView,
class RView>
118 template<
class SView,
class RView>
123 bool* stillSelected =
r.alloc<
bool>(n_iv);
128 for (
int i=n_iv;
i--;)
129 stillSelected[
i] =
false;
153 unsigned int maxCard = 0;
167 bool selectSingleInconsistent =
false;
168 if (x1.cardMax() <= 1) {
173 selectSingleInconsistent = diff2() || candidateCard < x0.cardMin();
184 if (selectSingleInconsistent ||
185 candidateCard > x0.cardMax() ||
191 stillSelected[
i] =
true;
194 if (vx1() && vx1.
val()==
i) {
198 ModEvent me = x0.includeI(home,candlb);
204 before[
i].update(home,sofarBefore);
209 maxCard =
std::max(maxCard, candidateCard);
210 minCard =
std::min(minCard, candidateCard);
216 if (x1.cardMax()==0) {
221 for (
int i=n_iv;
i--;)
222 if (stillSelected[
i])
229 if (x1.cardMin() > 0) {
236 me = x0.cardMin(home, minCard);
242 if (x1.cardMax() <= 1) {
243 ModEvent me = x0.cardMax(home, maxCard);
251 ModEvent me = x0.intersectI(home,sfB);
262 for (
int i=n_iv;
i--;) {
263 if (!stillSelected[
i])
291 assert(x0.assigned());
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
bool before(const ConstSetView &x, const ConstSetView &y)
virtual size_t dispose(Space &home)
Delete propagator and return its size.
ExecStatus ES_SUBSUMED(Propagator &p)
bool includeI(Space &home, I &i)
Include the set represented by i in this set.
unsigned int size(I &i)
Size of all ranges of range iterator i.
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)
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.
bool subset(I &i, J &j)
Check whether range iterator i is subset of range iterator j.
int val(void) const
Return current value.
Range iterator for integer sets.
virtual Actor * copy(Space &home, bool)
Copy propagator during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
ElementUnionConst(Space &home, bool share, ElementUnionConst &p)
Constructor for cloning p.
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 PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Home class for posting propagators
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.
Post propagator for SetVar SetOpType SetVar SetRelType r
Range iterator for computing set difference.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from space heap.
Range iterator for the greatest lower bound.
const Gecode::ModEvent ME_SET_FAILED
Domain operation has resulted in failure.
virtual void reschedule(Space &home)
Schedule function.
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.
@ ES_FIX
Propagation has computed fixpoint.
Range iterator for the least upper bound.
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.
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.
Propagator for element with union of constant sets
static ExecStatus post(Home home, SView z, const IntSetArgs &x, RView y)
Shrinking sets of integers.
int n
Number of negative literals for node type.
int ModEventDelta
Modification event deltas.
SetExpr inter(const SetVarArgs &x)
Intersection of set variables.
@ ES_OK
Execution is okay.
int p
Number of positive literals for node type.
const FloatNum max
Largest allowed float value.