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

Method get

examples/kakuro.cpp:435–448  ·  view source on GitHub ↗

Return possibly cached Data for \a n distinct variables with sum \a c

Source from the content-addressed store, hash-verified

433 Cache(void) : cache(nullptr) {}
434 /// Return possibly cached Data for \a n distinct variables with sum \a c
435 TupleSet get(int n, int c) {
436 for (Entry* e = cache; e != nullptr; e = e->next)
437 if ((e->n == n) && (e->c == c))
438 return e->ts;
439 {
440 Entry* e = new Entry;
441 e->n = n;
442 e->c = c;
443 e->ts = generate(n,c);
444 e->next = cache;
445 cache = e;
446 }
447 return cache->ts;
448 }
449 /// Delete cache entries
450 ~Cache(void) {
451 Entry* e = cache;

Callers 1

distinctlinearMethod · 0.45

Calls 1

generateFunction · 0.70

Tested by

no test coverage detected