38 namespace Gecode {
namespace Set {
namespace Rel {
81 while (i<cs->xsize && !cs->
b.
get(xoff+2*i+yoff))
88 : cs(&cs0), i(static_cast<unsigned int>(-1)),
89 xoff(xoff0), yoff(yoff0) {
95 int val(
void)
const {
return cs->
ub[
i]; }
100 template<
class View0,
class View1>
108 bool ymin(
int i)
const {
return b.
get(2*xsize+2*i); }
110 bool ymax(
int i)
const {
return b.
get(2*xsize+2*i+1); }
170 template<
class View0,
class View1>
197 template<
class View0,
class View1>
199 : xlm(false), xum(false), ylm(false), yum(false) {
217 for (
int i=0; xylubv(); ++xylubv, ++
i) {
219 if (xlv() && xylubv.
val()==xlv.
val()) {
223 if (xuv() && xylubv.
val()==xuv.
val()) {
227 if (ylv() && xylubv.
val()==ylv.
val()) {
231 if (yuv() && xylubv.
val()==yuv.
val()) {
238 template<
class View0,
class View1,
bool strict>
243 template<
class View0,
class View1,
bool strict>
248 template<
class View0,
class View1,
bool strict>
253 (void)
new (home)
Lq(home,x,y);
257 template<
class View0,
class View1,
bool strict>
260 return new (home)
Lq(home,share,*
this);
263 template<
class View0,
class View1,
bool strict>
266 if ( (!strict) && x1.cardMax()==0) {
270 if (x0.cardMax()==0) {
274 if (x0.glbMin() < x1.lubMin())
276 if (x1.glbMin() < x0.lubMin())
279 bool assigned = x0.assigned() && x1.assigned();
291 while ((i<n) && cs.
xmin(i) == cs.
ymax(i)) {
353 while ((i < n) && (cs.
xmax(i) == cs.
ymin(i))) {
382 while ((i < n) && (cs.
xmin(i) == cs.
ymax(i))) {
bool get(unsigned int i) const
Access value at bit i.
int size(void) const
Return size of combined upper bounds.
CSIter(void)
Default constructor.
const Gecode::ModEvent ME_SET_FAILED
Domain operation has resulted in failure.
int yoff
Offset for each element (0=lower bound, 1=upper bound)
Value iterator for characteristic function.
bool xmin(int i) const
Return minimum of element i for variable x.
ExecStatus ES_SUBSUMED(Propagator &p)
int val(void) const
Value of current iterator position.
void clear(unsigned int i)
Clear bit i.
bool xmax(int i) const
Return maximum of element i for variable x.
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.
Range iterator for the greatest lower bound.
CSIter(CharacteristicSets &cs0, int xoff0, int yoff0)
Constructor.
CharacteristicSets * cs
Pointer to the underlying set.
int xoff
Offset from start of bitset.
Range iterator for the least upper bound.
Base-class for both propagators and branchers.
ModEvent xlq(int i, bool j)
Update upper bound of to j.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
static ExecStatus post(Home home, View0, View1)
Post propagator .
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
void reset(void)
Reset iterator to start.
void set(int i, bool j)
Set bit i to value j.
Execution has resulted in failure.
bool ymin(int i) const
Return minimum of element i for variable y.
void operator++(void)
Move iterator to next element.
void ymin(int i, bool j)
Set minimum of element i for variable y to j.
Representation of the characteristic functions of two sets.
ModEvent ygq(int i, bool j)
Update lower bound of to j.
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.
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.
bool operator()(void) const
Test if iterator is finished.
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(int i, bool j)
Update upper bound of to j.
Node * x
Pointer to corresponding Boolean expression node.
bool xlm
Whether lower bound of x was updated.
ModEvent xgq(int i, bool j)
Update lower bound of to j.
void ymax(int i, bool j)
Set maximum of element i for variable y to j.
bool assigned(View x, int v)
Whether x is assigned to value v.
int * ub
Elements in the combined upper bounds.
Propagation has not computed fixpoint.
int val(void) const
Return current value.
void xmax(int i, bool j)
Set maximum of element i for variable x to j.
unsigned int xsize
Size of the combined upper bounds.
Gecode toplevel namespace
void xmin(int i, bool j)
Set minimum of element i for variable x to j.
int ModEventDelta
Modification event deltas.
Home class for posting propagators
bool xum
Whether upper bound of x was updated.
bool ylm
Whether lower bound of y was updated.
bool ymax(int i) const
Return maximum of element i for variable y.