MCPcopy Create free account
hub / github.com/Gecode/gecode / lq_full

Method lq_full

gecode/int/var-imp/int.cpp:86–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84 */
85
86 ModEvent
87 IntVarImp::lq_full(Space& home, int m) {
88 assert((m >= dom.min()) && (m <= dom.max()));
89 int old_max = dom.max();
90 ModEvent me = ME_INT_BND;
91 if (range()) { // Is already range...
92 dom.max(m);
93 if (assigned()) me = ME_INT_VAL;
94 } else if (m < fst()->next(nullptr)->min()) { // Becomes range...
95 dom.max(std::min(m,fst()->max()));
96 fst()->dispose(home,nullptr,lst());
97 fst(nullptr); holes = 0;
98 if (assigned()) me = ME_INT_VAL;
99 } else { // Stays non-range...
100 RangeList* n = nullptr;
101 RangeList* c = lst();
102 unsigned int h = 0;
103 while (m < c->min()) {
104 RangeList* p = c->prev(n); c->fix(n);
105 h += (c->min() - p->max() - 1);
106 n=c; c=p;
107 }
108 holes -= h;
109 int max_c = std::min(m,c->max());
110 dom.max(max_c); c->max(max_c);
111 if (c != lst()) {
112 n->dispose(home,lst());
113 c->next(n,nullptr); lst(c);
114 }
115 }
116 IntDelta d(dom.max()+1,old_max);
117 return notify(home,me,d);
118 }
119
120 ModEvent
121 IntVarImp::gq_full(Space& home, int m) {

Callers

nothing calls this directly

Calls 9

rangeFunction · 0.85
assignedFunction · 0.85
minFunction · 0.50
minMethod · 0.45
maxMethod · 0.45
nextMethod · 0.45
disposeMethod · 0.45
prevMethod · 0.45
fixMethod · 0.45

Tested by

no test coverage detected