From a0b89016dc7ea42fe8af0aeb956fd383cd1b66f1 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Wed, 8 Dec 2021 17:38:42 +0100 Subject: Faster and nice pruning table generation. Can still be improved with multithreading. --- src/pruning.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/pruning.c') diff --git a/src/pruning.c b/src/pruning.c index 716379e..6ea77e3 100644 --- a/src/pruning.c +++ b/src/pruning.c @@ -144,20 +144,20 @@ genptable(PruneData *pd) static void genptable_bfs(PruneData *pd, int d, Move *ms) { - int j; + int j, n; uint64_t i; Cube c, cc; + Trans t[NTRANS]; for (i = 0; i < pd->coord->max; i++) { - /* - * TODO: only do this if the position is "nasty", - * i.e. self-symmetrical with respect to the base - * coordinate but not overall. - */ if (ptableval_index(pd, i) == d) { + n = pd->coord->trans(i, t); + if (n == 1) + continue; + c = pd->coord->cube(i); - for (j = 0; j < pd->coord->ntrans; j++) { - cc = apply_trans(pd->coord->trans[j], c); + for (j = 0; j < n; j++) { + cc = apply_trans(t[j], c); if (ptableval(pd, cc) > d) ptable_update(pd, cc, d); } -- cgit v1.3