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

Function solutions

test/branch.cpp:412–428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410 /// Find number of solutions
411 template<class TestSpace>
412 int solutions(TestSpace* c, Gecode::Search::Options& o, Gecode::Support::RandomGenerator& rand, int maxNbSol = -1) {
413 o.a_d = rand(10);
414 o.c_d = rand(10);
415 Gecode::DFS<TestSpace> e_s(c, o);
416 delete c;
417
418 // Find number of solutions
419 int s = 0;
420 do {
421 Gecode::Space* ex = e_s.next();
422 if (ex == nullptr) break;
423 delete ex;
424 ++s;
425 if ((maxNbSol >= 0) && (maxNbSol == s)) break;
426 } while (true);
427 return s;
428 }
429
430 IntTest::IntTest(const std::string& s, int a, const Gecode::IntSet& d)
431 : Base("Int::Branch::"+s), arity(a), dom(d) {

Callers 1

runMethod · 0.70

Calls 1

nextMethod · 0.45

Tested by

no test coverage detected