diff options
Diffstat (limited to 'src/solvers/h48')
| -rw-r--r-- | src/solvers/h48/solve.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/solvers/h48/solve.h b/src/solvers/h48/solve.h index fcd2762..ce9f4c4 100644 --- a/src/solvers/h48/solve.h +++ b/src/solvers/h48/solve.h | |||
| @@ -68,6 +68,8 @@ STATIC_INLINE void h48_prune_pipeline(dfsarg_solve_h48_t [static 1], | |||
| 68 | h48_prune_t [static NMOVES], uint8_t, bool); | 68 | h48_prune_t [static NMOVES], uint8_t, bool); |
| 69 | STATIC_INLINE uint8_t h48_prune_lookup( | 69 | STATIC_INLINE uint8_t h48_prune_lookup( |
| 70 | uint64_t, cube_t, dfsarg_solve_h48_t [static 1]); | 70 | uint64_t, cube_t, dfsarg_solve_h48_t [static 1]); |
| 71 | STATIC_INLINE uint8_t h48_prune_lookup_nocoord( | ||
| 72 | cube_t, dfsarg_solve_h48_t [static 1]); | ||
| 71 | STATIC_INLINE void h48_prune_restore_normal(const h48_prune_t [static 1], | 73 | STATIC_INLINE void h48_prune_restore_normal(const h48_prune_t [static 1], |
| 72 | dfsarg_solve_h48_t [static 1], uint8_t); | 74 | dfsarg_solve_h48_t [static 1], uint8_t); |
| 73 | STATIC_INLINE void h48_prune_restore_inverse(const h48_prune_t [static 1], | 75 | STATIC_INLINE void h48_prune_restore_inverse(const h48_prune_t [static 1], |
| @@ -132,6 +134,20 @@ h48_prune_lookup( | |||
| 132 | } | 134 | } |
| 133 | } | 135 | } |
| 134 | 136 | ||
| 137 | STATIC_INLINE uint8_t | ||
| 138 | h48_prune_lookup_nocoord( | ||
| 139 | cube_t cube, | ||
| 140 | dfsarg_solve_h48_t arg[static 1] | ||
| 141 | ) | ||
| 142 | { | ||
| 143 | uint32_t cdata; | ||
| 144 | uint64_t coord; | ||
| 145 | |||
| 146 | get_h48_cdata(cube, arg->cocsepdata, &cdata); | ||
| 147 | coord = coord_h48_edges(cube, COCLASS(cdata), TTREP(cdata), arg->h); | ||
| 148 | return h48_prune_lookup(coord, cube, arg); | ||
| 149 | } | ||
| 150 | |||
| 135 | STATIC_INLINE void | 151 | STATIC_INLINE void |
| 136 | h48_prune_pipeline( | 152 | h48_prune_pipeline( |
| 137 | dfsarg_solve_h48_t arg[static 1], | 153 | dfsarg_solve_h48_t arg[static 1], |
| @@ -371,7 +387,7 @@ STATIC void * | |||
| 371 | solve_h48_runthread(void *arg) | 387 | solve_h48_runthread(void *arg) |
| 372 | { | 388 | { |
| 373 | int i, j; | 389 | int i, j; |
| 374 | uint8_t lastmove; | 390 | uint8_t lastmove, p; |
| 375 | int64_t d, f, nprev; | 391 | int64_t d, f, nprev; |
| 376 | dfsarg_solve_h48_t *dfsarg; | 392 | dfsarg_solve_h48_t *dfsarg; |
| 377 | 393 | ||
| @@ -395,6 +411,12 @@ solve_h48_runthread(void *arg) | |||
| 395 | move(dfsarg->cube, dfsarg->tasks[i].moves[j]); | 411 | move(dfsarg->cube, dfsarg->tasks[i].moves[j]); |
| 396 | dfsarg->inverse = inverse(dfsarg->cube); | 412 | dfsarg->inverse = inverse(dfsarg->cube); |
| 397 | 413 | ||
| 414 | dfsarg->nodes_visited++; | ||
| 415 | dfsarg->table_lookups++; | ||
| 416 | p = h48_prune_lookup_nocoord(dfsarg->cube, dfsarg); | ||
| 417 | if (p + H48_STARTING_MOVES > dfsarg->target_depth) | ||
| 418 | continue; | ||
| 419 | |||
| 398 | dfsarg->lb_normal = 0; | 420 | dfsarg->lb_normal = 0; |
| 399 | dfsarg->lb_inverse = 0; | 421 | dfsarg->lb_inverse = 0; |
| 400 | dfsarg->movemask_normal = allowedmask[ | 422 | dfsarg->movemask_normal = allowedmask[ |
