38 namespace Gecode {
namespace Set {
namespace Rel {
60 bool get(
unsigned int i)
const;
62 void set(
unsigned int i,
bool j);
89 template<
class View0,
class View1>
93 bool xmin(
unsigned int i)
const;
95 bool xmax(
unsigned int i)
const;
97 bool ymin(
unsigned int i)
const;
99 bool ymax(
unsigned int i)
const;
102 void xmin(
unsigned int i,
bool j);
104 void xmax(
unsigned int i,
bool j);
106 void ymin(
unsigned int i,
bool j);
108 void ymax(
unsigned int i,
bool j);
120 unsigned int size(
void)
const;
123 template<
class View0,
class View1>
149 unsigned int xoff0,
unsigned int yoff0)
150 : cs(&cs0),
i(0), xoff(xoff0), yoff(yoff0) {
157 while ((i < cs->
xsize) && !cs->get(xoff+2*
i+yoff))
184 return get(2*
xsize+2*
i+1);
249 template<
class View0,
class View1>
275 template<
class View0,
class View1>
296 for (
unsigned int i=0; xylubv(); ++xylubv, ++
i) {
298 if (xlv() && xylubv.
val()==xlv.
val()) {
302 if (xuv() && xylubv.
val()==xuv.
val()) {
306 if (ylv() && xylubv.
val()==ylv.
val()) {
310 if (yuv() && xylubv.
val()==yuv.
val()) {
317 template<
class View0,
class View1,
bool strict>
322 template<
class View0,
class View1,
bool strict>
327 template<
class View0,
class View1,
bool strict>
332 (void)
new (home)
Lq(home,
x,
y);
336 template<
class View0,
class View1,
bool strict>
339 return new (home)
Lq(home,share,*
this);
342 template<
class View0,
class View1,
bool strict>
345 if ( (!strict) && x1.cardMax()==0) {
349 if (x0.cardMax()==0) {
353 if (x0.glbMin() < x1.lubMin())
355 if (x1.glbMin() < x0.lubMin())
358 bool assigned = x0.assigned() && x1.assigned();
368 unsigned int firsti=0;
369 unsigned int n=cs.
size();
bool get(unsigned int i) const
Access value at bit i.
CSIter(void)
Default constructor.
const Gecode::ModEvent ME_SET_FAILED
Domain operation has resulted in failure.
Value iterator for characteristic function.
ExecStatus ES_SUBSUMED(Propagator &p)
unsigned int yoff
Offset for each element (0=lower bound, 1=upper bound)
void clear(unsigned int i)
Clear bit i.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
Support::BitSetBase b
Storage for the characteristic functions.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
int ModEvent
Type for modification events.
Propagator for set less than or equal
bool yum
Whether upper bound of y was updated.
ModEvent xgq(unsigned int i, bool j)
Update lower bound of to j.
Range iterator for the greatest lower bound.
unsigned int size(void) const
Return size of combined upper bounds.
bool operator()(void) const
Test if iterator is finished.
bool get(unsigned int i) const
Get bit i.
CharacteristicSets * cs
Pointer to the underlying set.
int val(void) const
Return current value.
Range iterator for the least upper bound.
Base-class for both propagators and branchers.
bool xmax(unsigned int i) const
Return maximum of element i for variable x.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
int val(void) const
Value of current iterator position.
int p
Number of positive literals for node type.
void set(unsigned int i, bool j)
Set bit i to value j.
Gecode::IntArgs i(4, 1, 2, 3, 4)
bool ymin(unsigned int i) const
Return minimum of element i for variable y.
int n
Number of negative literals for node type.
void reset(void)
Reset iterator to start.
Execution has resulted in failure.
bool xmin(unsigned int i) const
Return minimum of element i for variable x.
void operator++(void)
Move iterator to next element.
unsigned int cardMin(void) const
Return cardinality minimum.
Representation of the characteristic functions of two sets.
Value iterator from range iterator.
Range iterator from value iterator.
unsigned int size(I &i)
Size of all ranges of range iterator i.
Lq(Space &home, bool share, Lq &p)
Constructor for cloning p.
virtual Actor * copy(Space &home, bool)
Copy propagator during cloning.
void init(A &a, unsigned int s, bool setbits=false)
Initialize for s bits and allocator a (only after default constructor)
void set(unsigned int i)
Set bit i.
ModEvent xlq(unsigned int i, bool j)
Update upper bound of to j.
const Gecode::ModEvent ME_SET_NONE
Domain operation has not changed domain.
unsigned int i
Current position.
CharacteristicSets(Region &re, View0 x, View1 y)
Constructor.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
const Gecode::PropCond PC_SET_ANY
Propagate when any bound or the cardinality of a view changes.
ExecStatus prune(Space &home, View0 x, View1 y)
Prune x and y using computed bounds.
Range iterator for computing union (binary)
ModEvent ylq(unsigned int i, bool j)
Update upper bound of to j.
Post propagator for SetVar SetOpType SetVar y
bool xlm
Whether lower bound of x was updated.
bool assigned(View x, int v)
Whether x is assigned to value v.
static ExecStatus post(Home home, View0 x, View1 y)
Post propagator .
int * ub
Elements in the combined upper bounds.
Post propagator for SetVar x
Propagation has not computed fixpoint.
unsigned int xsize
Size of the combined upper bounds.
Gecode toplevel namespace
bool ymax(unsigned int i) const
Return maximum of element i for variable y.
ModEvent ygq(unsigned int i, bool j)
Update lower bound of to j.
int ModEventDelta
Modification event deltas.
unsigned int xoff
Offset from start of bitset.
Home class for posting propagators
bool xum
Whether upper bound of x was updated.
bool ylm
Whether lower bound of y was updated.