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

Method run

test/search.cpp:376–397  ·  view source on GitHub ↗

Run test

Source from the content-addressed store, hash-verified

374 htb1,htb2,htb3), c_d(c_d0), a_d(a_d0), t(t0) {}
375 /// Run test
376 virtual bool run(void) {
377 Model* m = new Model(htb1,htb2,htb3);
378 Gecode::Search::FailStop f(2);
379 Gecode::Search::Options o;
380 o.c_d = c_d;
381 o.a_d = a_d;
382 o.threads = t;
383 o.stop = &f;
384 Gecode::DFS<Model> dfs(m,o);
385 int n = m->solutions();
386 delete m;
387 while (true) {
388 Model* s = dfs.next();
389 if (s != nullptr) {
390 n--; delete s;
391 }
392 if ((s == nullptr) && !dfs.stopped())
393 break;
394 f.limit(f.limit()+2);
395 }
396 return n == 0;
397 }
398 };
399
400 /// %Test for limited discrepancy search

Callers

nothing calls this directly

Calls 4

solutionsMethod · 0.45
nextMethod · 0.45
stoppedMethod · 0.45
limitMethod · 0.45

Tested by

no test coverage detected