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

Function generate

examples/kakuro.cpp:404–415  ·  view source on GitHub ↗

\brief Generate tuple set for \a n distinct variables with sum \a c * \relates Kakuro */

Source from the content-addressed store, hash-verified

402 * \relates Kakuro
403 */
404 TupleSet generate(int n, int c) {
405 // Setup search engine that enumerates all solutions
406 DistinctLinear* e = new DistinctLinear(n,c);
407 DFS<DistinctLinear> d(e);
408 delete e;
409 TupleSet ts(n);
410 while (DistinctLinear* s = d.next()) {
411 ts.add(s->solution()); delete s;
412 }
413 ts.finalize();
414 return ts;
415 }
416
417 /** \brief Class to remember already computed specifications
418 * \relates Kakuro

Callers 1

getMethod · 0.70

Calls 4

nextMethod · 0.45
addMethod · 0.45
solutionMethod · 0.45
finalizeMethod · 0.45

Tested by

no test coverage detected