aboutsummaryrefslogtreecommitdiff
path: root/src/pruning.c
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano.tronto@gmail.com>2021-12-08 17:38:42 +0100
committerSebastiano Tronto <sebastiano.tronto@gmail.com>2021-12-08 17:38:42 +0100
commita0b89016dc7ea42fe8af0aeb956fd383cd1b66f1 (patch)
tree27dc3f3ff760f4b1339e9ebd5e5612caf3cd1c08 /src/pruning.c
parent131428b913a3d42f26714b8e5e873d8112db10c0 (diff)
downloadnissy-a0b89016dc7ea42fe8af0aeb956fd383cd1b66f1.tar.gz
nissy-a0b89016dc7ea42fe8af0aeb956fd383cd1b66f1.zip
Faster and nice pruning table generation. Can still be improved with multithreading.
Diffstat (limited to '')
-rw-r--r--src/pruning.c16
1 files changed, 8 insertions, 8 deletions
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)
144static void 144static void
145genptable_bfs(PruneData *pd, int d, Move *ms) 145genptable_bfs(PruneData *pd, int d, Move *ms)
146{ 146{
147 int j; 147 int j, n;
148 uint64_t i; 148 uint64_t i;
149 Cube c, cc; 149 Cube c, cc;
150 Trans t[NTRANS];
150 151
151 for (i = 0; i < pd->coord->max; i++) { 152 for (i = 0; i < pd->coord->max; i++) {
152 /*
153 * TODO: only do this if the position is "nasty",
154 * i.e. self-symmetrical with respect to the base
155 * coordinate but not overall.
156 */
157 if (ptableval_index(pd, i) == d) { 153 if (ptableval_index(pd, i) == d) {
154 n = pd->coord->trans(i, t);
155 if (n == 1)
156 continue;
157
158 c = pd->coord->cube(i); 158 c = pd->coord->cube(i);
159 for (j = 0; j < pd->coord->ntrans; j++) { 159 for (j = 0; j < n; j++) {
160 cc = apply_trans(pd->coord->trans[j], c); 160 cc = apply_trans(t[j], c);
161 if (ptableval(pd, cc) > d) 161 if (ptableval(pd, cc) > d)
162 ptable_update(pd, cc, d); 162 ptable_update(pd, cc, d);
163 } 163 }

Generated with cgit - Back to sebastiano.tronto.net