Go to the documentation of this file.
40 namespace Gecode {
namespace Set {
88 return lubSize() - glbSize();
180 return me_negateset((
x.exclude(home,
c)));
186 return me_negateset((
x.include(home,
c)));
194 return me_negateset((
x.includeI(home, csi)));
202 return me_negateset((
x.includeI(home, csi)));
208 return me_negateset(
x.exclude(home,j,k));
214 return me_negateset(
x.include(home,j,k));
220 return me_negateset(
x.includeI(home,iter));
226 return me_negateset(
x.excludeI(home,iter));
233 return me_negateset(
x.includeI(home,
c));
240 x.subscribe(home,
p, pc_negateset(pc),schedule);
246 x.cancel(home,
p, pc_negateset(pc));
264 return View::schedule(home,
p,me_negateset(me));
269 return me_negateset(View::me(med));
275 return me_negateset(View::med(me));
286 return me_negateset(View::modevent(
d));
361 unsigned int width(
void)
const;
368 : lb(s.
base()), lbc(lb) {}
468 unsigned int width(
void)
const;
475 : ub(s.
base()), ubc(ub) {}
540 template<
class Char,
class Traits,
class View>
541 std::basic_ostream<Char,Traits>&
544 std::basic_ostringstream<Char,Traits> s;
545 s.copyfmt(os); s.width(0);
546 s <<
"(" <<
x.base() <<
")^C";
547 return os << s.str();
554 return x.base() ==
y.base();
560 return x.base() !=
y.base();
ModEvent intersect(Space &home, int i, int j)
Update least upper bound to contain at most all elements between and including i and j.
ModEvent intersectI(Space &home, I &iter)
Intersect least upper bound with range sequence described by i.
Post propagator for SetVar x
const Gecode::PropCond PC_SET_CGLB
Propagate when the cardinality or the greatest lower bound of a view changes.
Post propagator for SetVar SetOpType SetVar y
bool operator()(void) const
Test whether iterator is still at a range or done.
bool notContains(int i) const
Test whether i is not in the least upper bound.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
int lubMax(void) const
Return maximum element of least upper bound.
ModEvent includeI(Space &home, I &i)
Include range sequence described by i in greatest lower bound.
unsigned int cardMax(void) const
Return maximum cardinality.
const Gecode::ModEvent ME_SET_CLUB
Domain operation has changed the least upper bound and the cardinality.
LubRanges(void)
Default constructor.
int lubMin(void) const
Return minimum of the least upper bound.
static ModEvent me(const ModEventDelta &med)
Return modification event for view type in med.
unsigned int cardMin(void) const
Return cardinality minimum.
int lubMin(void) const
Return minimum element of least upper bound.
static ModEventDelta med(ModEvent)
Translate modification event me to modification event delta for view.
void init(const T &x)
Initialize with least upper bound ranges for set variable x.
void subscribe(Space &home, Propagator &p, PropCond pc, bool schedule=true)
Subscribe propagator p with propagation condition pc to view.
int glbMax(void) const
Return maximum of the greatest lower bound.
bool lubAny(const Delta &d) const
Test whether arbitrary values got pruned from lub.
static const int MIN_OF_EMPTY
Returned by empty sets when asked for their minimum element.
bool operator!=(const CachedView< View > &x, const CachedView< View > &y)
unsigned int glbSize(void) const
Return the number of elements in the greatest lower bound.
Base-class for derived views.
Gecode toplevel namespace
Base-class for propagators.
int glbMin(void) const
Return minimum of the greatest lower bound.
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.
ModEvent include(Space &home, int i, int j)
Update greatest lower bound to include all elements between and including i and j.
int max(void) const
Return largest value of range.
const unsigned int card
Maximum cardinality of an integer set.
unsigned int lubSize(void) const
Return number of elements in the least upper bound.
static const int MAX_OF_EMPTY
Returned by empty sets when asked for their maximum element.
A complement iterator spezialized for the BndSet limits.
GlbRanges(void)
Default constructor.
int min(void) const
Return smallest value of range.
Generic domain change information to be supplied to advisors.
unsigned int unknownSize(void) const
Return the number of unknown elements.
const Gecode::PropCond PC_SET_CLUB
Propagate when the cardinality or the least upper bound of a view changes.
int lubMax(void) const
Return maximum of the least upper bound.
unsigned int lubSize(void) const
Return the number of elements in the least upper bound.
std::basic_ostream< Char, Traits > & operator<<(std::basic_ostream< Char, Traits > &os, const CachedView< View > &x)
const Gecode::ModEvent ME_SET_CGLB
Domain operation has changed the greatest lower bound and the cardinality.
void cancel(Space &home, Propagator &p, PropCond pc)
Cancel subscription of propagator p with propagation condition pc to view.
unsigned int cardMax(void) const
Return cardinality maximum.
const double base
Base for geometric restart sequence.
int max(void) const
Return largest value of range.
const Gecode::ModEvent ME_SET_NONE
Domain operation has not changed domain.
ModEvent excludeI(Space &home, I &i)
Remove range sequence described by i from least upper bound.
ModEvent exclude(Space &home, int i, int j)
Restrict least upper bound to not contain all elements between and including i and j.
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
static void schedule(Space &home, Propagator &p, ModEvent me)
Schedule propagator p with modification event me.
int min(void) const
Return smallest value of range.
int ModEvent
Type for modification events.
bool contains(int i) const
Test whether i is in greatest lower bound.
ComplementView(void)
Default constructor.
int PropCond
Type for propagation conditions.
bool operator==(const CachedView< View > &x, const CachedView< View > &y)
bool contains(int i) const
Test whether i is in the greatest lower bound.
View base(void) const
Return view from which this view is derived.
void operator++(void)
Move iterator to next range (if possible)
static PropCond pc_negateset(PropCond pc)
Negate the propagation condition pc.
unsigned int glbSize(void) const
Return number of elements in the greatest lower bound.
int max(void) const
Return largest value of range.
int glbMin(void) const
Return minimum element of greatest lower bound.
Range iterator for singleton range.
int glbMax(void) const
Return maximum of greatest lower bound.
bool operator()(void) const
Test whether iterator is still at a range or done.
unsigned int width(void) const
Return width of range (distance between minimum and maximum)
static ModEvent me_negateset(ModEvent me)
Negate the modification event me.
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Gecode::FloatVal c(-8, 8)
void operator++(void)
Move iterator to next range (if possible)
void init(const T &x)
Initialize with greatest lower bound ranges for set variable x.
int n
Number of negative literals for node type.
int min(void) const
Return smallest value of range.
int ModEventDelta
Modification event deltas.
Gecode::IntArgs i({1, 2, 3, 4})
unsigned int width(void) const
Return width of range (distance between minimum and maximum)
int p
Number of positive literals for node type.
unsigned int cardMin(void) const
Return minimum cardinality.
bool notContains(int i) const
Test whether i is not in the least upper bound.
static ModEvent modevent(const Delta &d)
Return modification event.
bool glbAny(const Delta &d) const
Test whether arbitrary values got pruned from glb.