diff options
Diffstat (limited to 'src/pruning.c')
| -rw-r--r-- | src/pruning.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/src/pruning.c b/src/pruning.c index 2dea797..36445b7 100644 --- a/src/pruning.c +++ b/src/pruning.c | |||
| @@ -258,25 +258,25 @@ genptable_compress(PruneData *pd) | |||
| 258 | static void | 258 | static void |
| 259 | genptable_fixnasty(PruneData *pd, int d) | 259 | genptable_fixnasty(PruneData *pd, int d) |
| 260 | { | 260 | { |
| 261 | uint64_t i; | 261 | uint64_t i, ii, mask; |
| 262 | int j, n; | 262 | Trans t; |
| 263 | Cube c, cc; | ||
| 264 | Trans t[NTRANS]; | ||
| 265 | 263 | ||
| 266 | if (pd->coord->transfind == NULL) | 264 | if (pd->coord->sd == NULL) |
| 267 | return; | 265 | return; |
| 268 | 266 | ||
| 269 | for (i = 0; i < pd->coord->max; i++) { | 267 | for (i = 0; i < pd->coord->max; i++) { |
| 270 | if (ptableval_index(pd, i) == d) { | 268 | if (ptableval_index(pd, i) == d) { |
| 271 | n = pd->coord->transfind(i, t); | 269 | mask = pd->coord->sd->selfsim[i]; |
| 272 | if (n == 1) | 270 | if (mask == (1 << uf)) |
| 273 | continue; | 271 | continue; |
| 274 | 272 | ||
| 275 | c = pd->coord->cube(i); | 273 | for (t = 0; t < NTRANS; t++) { |
| 276 | for (j = 0; j < n; j++) { | 274 | if (!((1 << t) & mask)) |
| 277 | cc = apply_trans(t[j], c); | 275 | continue; |
| 278 | if (ptableval(pd, cc) > d) { | 276 | |
| 279 | ptable_update(pd, cc, d); | 277 | ii = pd->coord->transform(t, i); |
| 278 | if (ptableval_index(pd, ii) > d) { | ||
| 279 | ptable_update_index(pd, ii, d); | ||
| 280 | pd->n++; | 280 | pd->n++; |
| 281 | } | 281 | } |
| 282 | } | 282 | } |
| @@ -306,7 +306,6 @@ instance_bfs(void *arg) | |||
| 306 | ThreadDataGenpt *td; | 306 | ThreadDataGenpt *td; |
| 307 | uint64_t i, ii, blocksize, rmin, rmax, updated; | 307 | uint64_t i, ii, blocksize, rmin, rmax, updated; |
| 308 | int j, pval, ichunk; | 308 | int j, pval, ichunk; |
| 309 | Cube c, cc; | ||
| 310 | Move *ms; | 309 | Move *ms; |
| 311 | 310 | ||
| 312 | td = (ThreadDataGenpt *)arg; | 311 | td = (ThreadDataGenpt *)arg; |
| @@ -324,15 +323,14 @@ instance_bfs(void *arg) | |||
| 324 | pval = ptableval_index(td->pd, i); | 323 | pval = ptableval_index(td->pd, i); |
| 325 | pthread_mutex_unlock(td->mutex[ichunk]); | 324 | pthread_mutex_unlock(td->mutex[ichunk]); |
| 326 | if (pval == td->d) { | 325 | if (pval == td->d) { |
| 327 | c = td->pd->coord->cube(i); | ||
| 328 | for (j = 0; ms[j] != NULLMOVE; j++) { | 326 | for (j = 0; ms[j] != NULLMOVE; j++) { |
| 329 | cc = apply_move(ms[j], c); | 327 | ii = td->pd->coord->move(ms[j], i); |
| 330 | ii = td->pd->coord->index(cc); | ||
| 331 | ichunk = findchunk(td->pd, td->nchunks, ii); | 328 | ichunk = findchunk(td->pd, td->nchunks, ii); |
| 332 | pthread_mutex_lock(td->mutex[ichunk]); | 329 | pthread_mutex_lock(td->mutex[ichunk]); |
| 333 | pval = ptableval_index(td->pd, ii); | 330 | pval = ptableval_index(td->pd, ii); |
| 334 | if (pval > td->d+1) { | 331 | if (pval > td->d+1) { |
| 335 | ptable_update(td->pd, cc, td->d+1); | 332 | ptable_update_index(td->pd, |
| 333 | ii, td->d+1); | ||
| 336 | updated++; | 334 | updated++; |
| 337 | } | 335 | } |
| 338 | pthread_mutex_unlock(td->mutex[ichunk]); | 336 | pthread_mutex_unlock(td->mutex[ichunk]); |
