Rewrite mightsee_more to manipulate the sets directly.

While using set operators was clearer, it was rather expensive (about 25s
for gmsp3v2). qfvis now completes the map in about 695s (single threaded).
About 15s faster than tyr for the same conditions (1 thread, level 4).
This commit is contained in:
Bill Currie 2013-03-16 21:51:41 +09:00
parent 27bb337a60
commit 2ea143283c

View file

@ -234,9 +234,16 @@ static inline int
mightsee_more (set_t *might, const set_t *prev_might, const set_t *test, mightsee_more (set_t *might, const set_t *prev_might, const set_t *test,
const set_t *vis) const set_t *vis)
{ {
set_assign (might, prev_might); unsigned i;
set_intersection (might, test); set_bits_t more = 0;
return !set_is_subset (vis, might);
// might = intersection (prev_might, test)
// more = (might is not a subset of vis)
for (i = 0; i < SET_WORDS (might); i++) {
might->map[i] = prev_might->map[i] & test->map[i];
more |= might->map[i] & ~vis->map[i];
}
return more != 0;
} }
/* /*