40namespace Gecode {
namespace Set {
namespace Sequence {
45 int lastElem =
x.size()-1;
52 for (
int i=0; i<lastElem; i++) {
53 if (
x[i].glbSize() > 0)
54 cur_max = std::max(cur_max,
x[i].glbMax());
55 if (
x[i].cardMin() > 0)
56 cur_max = std::max(cur_max,
x[i].lubMinN(
x[i].cardMin()-1));
63 if (
x[lastElem-i].lubSize() > 0) {
64 cur_min = std::min(cur_min,
x[lastElem-i].glbMin());
65 if (
x[lastElem-i].cardMin() > 0) {
71 ub[2*j]=ubr.min(); ub[2*j+1]=ubr.max();
73 unsigned int xcm =
x[lastElem-i].
cardMin()-1;
75 unsigned int width =
static_cast<unsigned int>(ub[2*j+1]-ub[2*j]+1);
77 maxN =
static_cast<int>(ub[2*j+1]-xcm);
82 cur_min = std::min(cur_min, maxN);
87 x[lastElem-i-1].
exclude(home, cur_min,
unsigned int cardMin(void) const
Return cardinality minimum.
static const int MAX_OF_EMPTY
Returned by empty sets when asked for their maximum element.
static const int MIN_OF_EMPTY
Returned by empty sets when asked for their minimum element.
Range iterator for the least upper bound.
Array with arbitrary number of elements.
const int min
Smallest allowed integer value.
const int max
Largest allowed integer value.
ModEvent exclude(Space &home, View &x, int s)
Prune view x to exclude all values from s.
ExecStatus propagateSeq(Space &home, bool &modified, bool &assigned, ViewArray< SetView > &x)
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
@ ES_NOFIX
Propagation has not computed fixpoint.
Post propagator for SetVar x
#define GECODE_SET_ME_CHECK_VAL_B(modified, tell, f)