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

Method supports

gecode/int/extensional/compact.hpp:147–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145
146 template<class View, bool pos>
147 forceinline const BitSetData*
148 Compact<View,pos>::supports(CTAdvisor& a, int n) {
149 const Range* fnd;
150 const Range* fst=a.fst();
151 const Range* lst=a.lst();
152 if (pos) {
153 if (n <= fst->max) {
154 fnd=fst;
155 } else if (n >= lst->min) {
156 fnd=lst;
157 } else {
158 fnd=range(a,n);
159 }
160 } else {
161 if ((n < fst->min) || (n > lst->max))
162 return nullptr;
163 if (n <= fst->max) {
164 fnd=fst;
165 } else if (n >= lst->min) {
166 fnd=lst;
167 } else {
168 fnd=range(a,n);
169 if (!fnd)
170 return nullptr;
171 }
172 }
173 assert((fnd->min <= n) && (n <= fnd->max));
174 return fnd->supports(n_words,n);
175 }
176
177 template<class View, bool pos>
178 forceinline void

Callers 7

findMethod · 0.45
compact.hppFile · 0.45
operator ++Method · 0.45
setupMethod · 0.45
propagateMethod · 0.45
adviseMethod · 0.45
finalizeMethod · 0.45

Calls 3

rangeFunction · 0.85
fstMethod · 0.45
lstMethod · 0.45

Tested by

no test coverage detected