34 namespace Gecode {
namespace Set {
namespace Rel {
56 bool get(
unsigned int i)
const;
58 void set(
unsigned int i,
bool j);
85 template<
class View0,
class View1>
89 bool xmin(
unsigned int i)
const;
91 bool xmax(
unsigned int i)
const;
93 bool ymin(
unsigned int i)
const;
95 bool ymax(
unsigned int i)
const;
98 void xmin(
unsigned int i,
bool j);
100 void xmax(
unsigned int i,
bool j);
102 void ymin(
unsigned int i,
bool j);
104 void ymax(
unsigned int i,
bool j);
116 unsigned int size(
void)
const;
119 template<
class View0,
class View1>
145 unsigned int xoff0,
unsigned int yoff0)
180 return get(2*
xsize+2*i+1);
197 set(2*
xsize+2*i+1,j);
245 template<
class View0,
class View1>
271 template<
class View0,
class View1>
292 for (
unsigned int i=0; xylubv(); ++xylubv, ++
i) {
294 if (xlv() && xylubv.
val()==xlv.
val()) {
298 if (xuv() && xylubv.
val()==xuv.
val()) {
302 if (ylv() && xylubv.
val()==ylv.
val()) {
306 if (yuv() && xylubv.
val()==yuv.
val()) {
313 template<
class View0,
class View1,
bool strict>
318 template<
class View0,
class View1,
bool strict>
323 template<
class View0,
class View1,
bool strict>
330 (void)
new (home)
Lq(home,x,y);
334 template<
class View0,
class View1,
bool strict>
337 return new (home)
Lq(home,*
this);
340 template<
class View0,
class View1,
bool strict>
343 if ( (!strict) &&
x1.cardMax()==0) {
347 if (
x0.cardMax()==0) {
351 if (
x0.glbMin() <
x1.lubMin())
353 if (
x1.glbMin() <
x0.lubMin())
366 unsigned int firsti=0;
367 unsigned int n=cs.
size();
368 while ((i<n) && (cs.
xmin(i) == cs.
ymax(i))) {
430 while ((i < n) && (cs.
xmax(i) == cs.
ymin(i))) {
459 while ((i < n) && (cs.
xmin(i) == cs.
ymax(i))) {
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.
View0 x0
View of type View0.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
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.
View1 x1
View of type View1.
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.
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.
Gecode::IntArgs i({1, 2, 3, 4})
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.
bool same(VX, VY)
Test whether two views are in fact the same.
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.
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.
Lq(Space &home, Lq &p)
Constructor for cloning p.
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.