diff options
Diffstat (limited to 'src/solvers/coord')
| -rw-r--r-- | src/solvers/coord/eo.h | 1 | ||||
| -rw-r--r-- | src/solvers/coord/solve.h | 8 | ||||
| -rw-r--r-- | src/solvers/coord/types_macros.h | 1 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src/solvers/coord/eo.h b/src/solvers/coord/eo.h index 449397f..46a6f70 100644 --- a/src/solvers/coord/eo.h +++ b/src/solvers/coord/eo.h | |||
| @@ -15,6 +15,7 @@ STATIC coord_t coordinate_eo = { | |||
| 15 | [AXIS_RL] = TRANS_URr, | 15 | [AXIS_RL] = TRANS_URr, |
| 16 | [AXIS_FB] = TRANS_UFr, | 16 | [AXIS_FB] = TRANS_UFr, |
| 17 | }, | 17 | }, |
| 18 | .is_admissible = &are_lastmoves_singlecw, | ||
| 18 | }; | 19 | }; |
| 19 | 20 | ||
| 20 | STATIC uint64_t | 21 | STATIC uint64_t |
diff --git a/src/solvers/coord/solve.h b/src/solvers/coord/solve.h index 73ae9b1..6903d1e 100644 --- a/src/solvers/coord/solve.h +++ b/src/solvers/coord/solve.h | |||
| @@ -35,15 +35,17 @@ solve_coord_appendsolution(dfsarg_solve_coord_t *arg) | |||
| 35 | char *m; | 35 | char *m; |
| 36 | 36 | ||
| 37 | if (*arg->nsols >= arg->maxsolutions || | 37 | if (*arg->nsols >= arg->maxsolutions || |
| 38 | arg->nmoves > *arg->shortest_sol + arg->optimal) | 38 | arg->nmoves > *arg->shortest_sol + arg->optimal || |
| 39 | (arg->coord->is_admissible != NULL && | ||
| 40 | !arg->coord->is_admissible(arg->nmoves, arg->moves))) | ||
| 39 | return 0; | 41 | return 0; |
| 40 | 42 | ||
| 41 | sortparallel(arg->moves, arg->nmoves); | ||
| 42 | |||
| 43 | t = inverse_trans(arg->trans); | 43 | t = inverse_trans(arg->trans); |
| 44 | for (i = 0; i < arg->nmoves; i++) | 44 | for (i = 0; i < arg->nmoves; i++) |
| 45 | tmoves[i] = transform_move(arg->moves[i], t); | 45 | tmoves[i] = transform_move(arg->moves[i], t); |
| 46 | 46 | ||
| 47 | sortparallel(tmoves, arg->nmoves); | ||
| 48 | |||
| 47 | l = arg->solutions_size - *arg->solutions_used; | 49 | l = arg->solutions_size - *arg->solutions_used; |
| 48 | m = *arg->solutions + *arg->solutions_used; | 50 | m = *arg->solutions + *arg->solutions_used; |
| 49 | strl = writemoves(tmoves, arg->nmoves, l, m); | 51 | strl = writemoves(tmoves, arg->nmoves, l, m); |
diff --git a/src/solvers/coord/types_macros.h b/src/solvers/coord/types_macros.h index 84085ad..2309efc 100644 --- a/src/solvers/coord/types_macros.h +++ b/src/solvers/coord/types_macros.h | |||
| @@ -11,4 +11,5 @@ typedef struct { | |||
| 11 | uint32_t moves_mask; | 11 | uint32_t moves_mask; |
| 12 | uint64_t trans_mask; | 12 | uint64_t trans_mask; |
| 13 | uint8_t axistrans[3]; | 13 | uint8_t axistrans[3]; |
| 14 | bool (*is_admissible)(int n, uint8_t [n]); | ||
| 14 | } coord_t; | 15 | } coord_t; |
