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

Method find

gecode/search/par/bab.hpp:147–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145 */
146 template<class Tracer>
147 forceinline void
148 BAB<Tracer>::Worker::find(void) {
149 // Try to find new work (even if there is none)
150 for (unsigned int i=0U; i<engine().workers(); i++) {
151 unsigned long int r_d = 0ul;
152 typename Engine<Tracer>::Worker* wi = engine().worker(i);
153 if (Space* s = wi->steal(r_d,wi->tracer,tracer)) {
154 // Reset this guy
155 m.acquire();
156 idle = false;
157 // Not idle but also does not have the root of the tree
158 path.ngdl(0);
159 d = 0;
160 cur = s;
161 mark = 0;
162 if (best != nullptr)
163 cur->constrain(*best);
164 Statistics t = *this;
165 Search::Worker::reset(r_d);
166 (*this) += t;
167 m.release();
168 return;
169 }
170 }
171 }
172
173 /*
174 * Statistics

Callers

nothing calls this directly

Calls 7

workersMethod · 0.45
workerMethod · 0.45
stealMethod · 0.45
acquireMethod · 0.45
ngdlMethod · 0.45
constrainMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected