| 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) { |