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

Method gq_full

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

Source from the content-addressed store, hash-verified

118 }
119
120 ModEvent
121 IntVarImp::gq_full(Space& home, int m) {
122 assert((m >= dom.min()) && (m <= dom.max()));
123 int old_min = dom.min();
124 ModEvent me = ME_INT_BND;
125 if (range()) { // Is already range...
126 dom.min(m);
127 if (assigned()) me = ME_INT_VAL;
128 } else if (m > lst()->prev(nullptr)->max()) { // Becomes range...
129 dom.min(std::max(m,lst()->min()));
130 fst()->dispose(home,nullptr,lst());
131 fst(nullptr); holes = 0;
132 if (assigned()) me = ME_INT_VAL;
133 } else { // Stays non-range...
134 RangeList* p = nullptr;
135 RangeList* c = fst();
136 unsigned int h = 0;
137 while (m > c->max()) {
138 RangeList* n = c->next(p); c->fix(n);
139 h += (n->min() - c->max() - 1);
140 p=c; c=n;
141 }
142 holes -= h;
143 int min_c = std::max(m,c->min());
144 dom.min(min_c); c->min(min_c);
145 if (c != fst()) {
146 fst()->dispose(home,p);
147 c->prev(p,nullptr); fst(c);
148 }
149 }
150 IntDelta d(old_min,dom.min()-1);
151 return notify(home,me,d);
152 }
153
154 ModEvent
155 IntVarImp::eq_full(Space& home, int m) {

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected