Go to the documentation of this file.
40 namespace Gecode {
namespace Set {
56 unsigned int cardMin,
unsigned int cardMax)
58 lub(home,ubMin,ubMax), glb(home,lbMin,lbMax) {
65 const IntSet& theGlb,
int ubMin,
int ubMax,
66 unsigned int cardMin,
unsigned int cardMax)
68 lub(home,ubMin,ubMax), glb(home,theGlb) {
75 int lbMin,
int lbMax,
const IntSet& theLub,
76 unsigned int cardMin,
unsigned int cardMax)
78 lub(home,theLub), glb(home,lbMin,lbMax) {
86 unsigned int cardMin,
unsigned int cardMax)
167 return cardMin_full(home);
177 return cardMax_full(home);
189 int oldMin = lub.
min();
190 int oldMax = lub.
max();
194 d._lubMin = lub.
max()+1;
196 }
else if (j == oldMax) {
198 d._lubMax = lub.
min()-1;
200 return processLubChange(home,
d);
228 int mi=iterator.min();
229 int ma=iterator.max();
232 return intersectI_full(home, mi, ma, iterator);
239 SetVarImp::intersectI_full(
Space& home,
int mi,
int ma, I& iterator) {
282 return processGlbChange(home,
d);
302 int mi=iterator.min();
303 int ma=iterator.max();
306 return includeI_full(home, mi, ma, iterator);
313 SetVarImp::includeI_full(
Space& home,
int mi,
int ma, I& iterator) {
356 return processLubChange(home,
d);
375 int mi=iterator.min();
376 int ma=iterator.max();
379 return excludeI_full(home, mi, ma, iterator);
386 SetVarImp::excludeI_full(
Space& home,
int mi,
int ma, I& iterator) {
bool knownOut(int) const
Test whether n is not contained in least upper bound.
int min(void) const
Return smallest element.
Post propagator for SetVar x
SetVarImp(Space &home, SetVarImp &x)
Constructor for cloning x.
bool include(Space &home, int i, int j, SetDelta &d)
Include the set in this set.
Range iterator for appending a singleton with a range iterator
int lubMinN(unsigned int n) const
Return n -th smallest element in the least upper bound.
int lubMax(void) const
Return maximum of the least upper bound.
bool exclude(Space &home, int i, int j, SetDelta &d)
Exclude the set from this set.
bool includeI(Space &home, I &i)
Include the set represented by i in this set.
unsigned int cardMin(void) const
Return current cardinality minimum.
int max(void) const
Return greatest element.
ModEvent fail(Space &home)
Run advisors to be run on failure and returns ME_GEN_FAILED.
bool intersectI(Space &home, I &i)
Exclude all elements not in the set represented by i from this set.
const Gecode::ModEvent ME_SET_CLUB
Domain operation has changed the least upper bound and the cardinality.
LubRanges(void)
Default constructor.
static bool lubAny(const Delta &d)
Test whether arbitrary values got pruned from lub.
ModEvent intersect(Space &home, int n)
Exclude everything but n from the least upper bound.
unsigned int cardMax(void) const
Return current cardinality maximum.
const FloatNum min
Smallest allowed float value.
static bool glbAny(const Delta &d)
Test whether arbitrary values got pruned from glb.
const Gecode::ModEvent ME_SET_VAL
Domain operation has resulted in a value (assigned variable)
ModEvent exclude(Space &home, int n)
Exclude n from the least upper bound.
void init(const T &x)
Initialize with least upper bound ranges for set variable x.
bool subset(I &i, J &j)
Check whether range iterator i is subset of range iterator j.
void excludeAll(Space &home)
Exclude all elements from this set.
int minN(unsigned int n) const
Return n -th smallest element.
bool in(int i) const
Test whether i is an element of this set.
void become(Space &home, const BndSet &s)
Make this set equal to s.
Gecode toplevel namespace
const Gecode::ModEvent ME_SET_GLB
Domain operation has changed the greatest lower bound.
const Gecode::ModEvent ME_SET_LUB
Domain operation has changed the least upper bound.
bool assigned(void) const
Test whether variable is assigned.
int lubMin(void) const
Return minimum of the least upper bound.
const unsigned int card
Maximum cardinality of an integer set.
GlbRanges(void)
Default constructor.
Generic domain change information to be supplied to advisors.
VarImp * forward(void) const
Use forward pointer if variable already copied.
ModEvent intersectI(Space &home, I &i)
Exclude everything but set described by i from the least upper bound.
unsigned int size(void) const
Return size.
Range iterator for computing intersection (binary)
SetVarImp * copy(Space &home)
Return copy of this variable.
Range iterator for computing set difference.
bool excludeI(Space &home, I &i)
Exclude all elements in the set represented by i from this set.
const Gecode::ModEvent ME_SET_CGLB
Domain operation has changed the greatest lower bound and the cardinality.
int glbMax(void) const
Return maximum of the greatest lower bound.
Range iterator for the greatest lower bound.
void init(const BndSet &s)
Initialize with BndSet s.
const Gecode::ModEvent ME_SET_NONE
Domain operation has not changed domain.
int glbMin(void) const
Return minimum of the greatest lower bound.
int ModEvent
Type for modification events.
ModEvent includeI(Space &home, I &i)
Include set described by i in the greatest lower bound.
Gecode::ModEvent notify(Gecode::Space &home, Gecode::ModEvent me, Gecode::Delta &d)
Notify that variable implementation has been modified with modification event me and delta informatio...
Base-class for Set-variable implementations.
unsigned int glbSize(void) const
Return the size of the greatest lower bound.
Finite set delta information for advisors.
Range iterator for the least upper bound.
static ModEvent me(const ModEventDelta &med)
Project modification event for this variable type from med.
Finite integer set variable implementation.
Range iterator for integer sets.
Range iterator for singleton range.
bool knownIn(int n) const
Test whether n is contained in greatest lower bound.
bool copied(void) const
Is variable already copied.
void init(const T &x)
Initialize with greatest lower bound ranges for set variable x.
int n
Number of negative literals for node type.
ModEvent include(Space &home, int n)
Include n in the greatest lower bound.
Gecode::IntArgs i({1, 2, 3, 4})
const FloatNum max
Largest allowed float value.
ModEvent excludeI(Space &home, I &i)
Exclude set described by i from the least upper bound.
unsigned int card(void) const
Return cardinality.
bool intersect(Space &home, int i, int j)
Intersect this set with the set .
unsigned int lubSize(void) const
Return the size of the least upper bound.