Go to the documentation of this file.
44 namespace Gecode {
namespace Set {
namespace Int {
90 assert(x0.cardMin()>=1);
94 unsigned int size = 0;
98 int* ub =
r.alloc<
int>(
size*2);
103 ub[2*
i+1] = ubr.max();
106 unsigned int x0cm = x0.cardMin()-1;
107 for (
unsigned int i=
size;
i--;) {
108 unsigned int width = static_cast<unsigned int>(ub[2*
i+1]-ub[2*
i]+1);
110 maxN = static_cast<int>(ub[2*
i+1]-x0cm);
165 if ((x0.cardMax() == 0) ||
166 ((x1.max() < x0.lubMin()) || (x1.min() > x0.lubMax())) ||
167 ((x0.glbSize() > 0) && (x0.glbMin() < x1.min())))
171 if (x1.assigned() && x1.val()==x0.lubMin()) {
177 if (x0.glbMin() == x0.lubMin()) {
184 if (x1.assigned() && x0.glbSize() > 0 && x1.val()==x0.glbMin()) {
185 unsigned int oldGlbSize = x0.glbSize();
198 if (!ur() || ur.
min()>x1.val()) {
226 int* _ur =
r.alloc<
int>(num_ranges*2);
231 _ur[2*
i ] = ur.min();
232 _ur[2*
i+1] = ur.max();
237 unsigned int n = x0.cardMin();
239 for (
int i=num_ranges;
i--; ) {
241 unsigned int num_values = static_cast<unsigned int>(_ur[2*
i+1]-_ur[2*
i]+1);
243 if (num_values >=
n) {
245 nth_largest = static_cast<int>(_ur[2*
i+1]-
n+1);
252 if (x1.min() > nth_largest)
258 template<
class View, ReifyMode rm>
267 template<
class View, ReifyMode rm>
275 template<
class View, ReifyMode rm>
282 template<
class View, ReifyMode rm>
288 template<
class View, ReifyMode rm>
306 if ((x0.cardMax() == 0) ||
307 ((x1.max() < x0.lubMin()) || (x1.min() > x0.lubMax())) ||
308 ((x0.glbSize() > 0) && (x0.glbMin() < x1.min())))
315 if (x0.glbMin() == x0.lubMin()) {
318 if (x1.val() == x0.glbMin()) {
328 else if ((x0.glbMin() < x1.min()) ||
329 (x0.glbMin() > x1.max()) ||
427 assert(x0.cardMin()>=1);
475 if ((x0.cardMax() == 0) ||
476 ((x1.max() < x0.lubMin()) || (x1.min() > x0.lubMax())) ||
477 ((x0.glbSize() > 0) && (x0.glbMax() > x1.max())))
481 if (x1.assigned() && x1.val()==x0.lubMax()) {
487 if (x0.glbMax() == x0.lubMax()) {
494 if (x1.assigned() && x0.glbSize() > 0 && x1.val()==x0.glbMax()) {
495 unsigned int oldGlbSize = x0.glbSize();
500 while (ur.
max() < x1.val()) {
506 if (ur.
width() == 1) {
529 unsigned int n = x0.cardMin();
532 if (ur.width() >=
n) {
534 nth_smallest = static_cast<int>(ur.min() +
n - 1);
541 if (x1.max() < nth_smallest)
547 template<
class View, ReifyMode rm>
556 template<
class View, ReifyMode rm>
563 template<
class View, ReifyMode rm>
572 template<
class View, ReifyMode rm>
578 template<
class View, ReifyMode rm>
596 if ((x0.cardMax() == 0) ||
597 ((x1.max() < x0.lubMin()) || (x1.min() > x0.lubMax())) ||
598 ((x0.glbSize() > 0) && (x0.glbMax() > x1.max())))
605 if (x0.glbMax() == x0.lubMax()) {
608 if (x1.val() == x0.glbMax()) {
618 else if ((x0.glbMax() < x1.min()) ||
619 (x0.glbMax() > x1.max()) ||
643 unsigned int n = x0.cardMin();
649 nth_smallest = static_cast<int>(ur.min() +
n - 1);
656 if (x1.max() < nth_smallest) {
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
static ExecStatus post(Home home, View s, Gecode::Int::IntView x, Gecode::Int::BoolView b)
Post reified propagator for b iff x is the largest element of s.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Inverse implication for reification.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
ExecStatus ES_SUBSUMED(Propagator &p)
static ExecStatus post(Home home, View s, Gecode::Int::IntView x)
Post propagator for x is the largest element of s.
unsigned int size(I &i)
Size of all ranges of range iterator i.
const int min
Smallest allowed integer in integer set.
Implication for reification.
Range iterator for the unknown set.
Base-class for both propagators and branchers.
ReMaxElement(Space &home, ReMaxElement &p)
Constructor for cloning p.
static const int MIN_OF_EMPTY
Returned by empty sets when asked for their minimum element.
NotMaxElement(Space &home, NotMaxElement &p)
Constructor for cloning p.
unsigned int width(void) const
Return width of range (distance between minimum and maximum)
Boolean view for Boolean variables.
Gecode toplevel namespace
const int max
Largest allowed integer in integer set.
static const int MAX_OF_EMPTY
Returned by empty sets when asked for their maximum element.
Propagator for reified minimum element
int min(void) const
Return smallest value of range.
Reified mixed binary propagator.
Home class for posting propagators
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
NotMinElement(Space &home, NotMinElement &p)
Constructor for cloning p.
Range iterator for computing intersection (binary)
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Post propagator for SetVar SetOpType SetVar SetRelType r
ReMinElement(Space &home, ReMinElement &p)
Constructor for cloning p.
MinElement(Space &home, MinElement &p)
Constructor for cloning p.
static ExecStatus post(Home home, View s, Gecode::Int::IntView x)
Post propagator for x is the minimal element of s.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Propagator for not maximum element
static ExecStatus post(Home home, View s, Gecode::Int::IntView x)
Post propagator for x is not the minimal element of s.
static ExecStatus post(Home home, View s, Gecode::Int::IntView x, Gecode::Int::BoolView b)
Post reified propagator for b iff x is the minimal element of s.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Propagator for maximum element
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Propagation has computed fixpoint.
int max(void) const
Return largest value of range.
Integer view for integer variables.
const Gecode::PropCond PC_SET_ANY
Propagate when any bound or the cardinality of a view changes.
Reified propagator for maximum element
MaxElement(Space &home, MaxElement &p)
Constructor for cloning p.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
static ExecStatus post(Home home, View s, Gecode::Int::IntView x)
Post propagator for x is not the largest element of s.
Propagator for not minimum element
int n
Number of negative literals for node type.
Propagator for minimum element
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
int ModEventDelta
Modification event deltas.
Gecode::IntArgs i({1, 2, 3, 4})
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
int p
Number of positive literals for node type.
virtual Actor * copy(Space &home)
Copy propagator during cloning.