diff options
Diffstat (limited to 'src/solvers/coord')
| -rw-r--r-- | src/solvers/coord/multisolve.h | 9 | ||||
| -rw-r--r-- | src/solvers/coord/solve.h | 9 |
2 files changed, 10 insertions, 8 deletions
diff --git a/src/solvers/coord/multisolve.h b/src/solvers/coord/multisolve.h index f3589e8..a45bd6a 100644 --- a/src/solvers/coord/multisolve.h +++ b/src/solvers/coord/multisolve.h | |||
| @@ -9,6 +9,7 @@ typedef struct { | |||
| 9 | uint8_t target_depth; | 9 | uint8_t target_depth; |
| 10 | solution_moves_t *solution_moves; | 10 | solution_moves_t *solution_moves; |
| 11 | solution_settings_t *solution_settings; | 11 | solution_settings_t *solution_settings; |
| 12 | uint64_t tmask; | ||
| 12 | solution_list_t *solution_list; | 13 | solution_list_t *solution_list; |
| 13 | multicoord_t *mcoord; | 14 | multicoord_t *mcoord; |
| 14 | const unsigned char *coord_data[MAX_MULTICOORD_NCOORDS]; | 15 | const unsigned char *coord_data[MAX_MULTICOORD_NCOORDS]; |
| @@ -87,7 +88,7 @@ solve_multicoord_dfs(dfsarg_solve_multicoord_t arg[static 1]) | |||
| 87 | /* All coordinates are solved */ | 88 | /* All coordinates are solved */ |
| 88 | if (!multicoord_solution_admissible(arg)) | 89 | if (!multicoord_solution_admissible(arg)) |
| 89 | return 0; | 90 | return 0; |
| 90 | return appendsolution(arg->solution_moves, | 91 | return appendsolution(arg->solution_moves, 1, &arg->tmask, |
| 91 | arg->solution_settings, arg->solution_list); | 92 | arg->solution_settings, arg->solution_list); |
| 92 | 93 | ||
| 93 | solve_multicoord_dfs_notsolved: | 94 | solve_multicoord_dfs_notsolved: |
| @@ -208,7 +209,6 @@ solve_multicoord( | |||
| 208 | solution_moves_reset(&solution_moves); | 209 | solution_moves_reset(&solution_moves); |
| 209 | 210 | ||
| 210 | solution_settings = (solution_settings_t) { | 211 | solution_settings = (solution_settings_t) { |
| 211 | .tmask = TM_SINGLE(inverse_trans(trans)), | ||
| 212 | .unniss = false, | 212 | .unniss = false, |
| 213 | .maxmoves = maxmoves, | 213 | .maxmoves = maxmoves, |
| 214 | .maxsolutions = maxsolutions, | 214 | .maxsolutions = maxsolutions, |
| @@ -222,6 +222,7 @@ solve_multicoord( | |||
| 222 | .mcoord = mcoord, | 222 | .mcoord = mcoord, |
| 223 | .solution_moves = &solution_moves, | 223 | .solution_moves = &solution_moves, |
| 224 | .solution_settings = &solution_settings, | 224 | .solution_settings = &solution_settings, |
| 225 | .tmask = TM_SINGLE(inverse_trans(trans)), | ||
| 225 | .solution_list = &solution_list, | 226 | .solution_list = &solution_list, |
| 226 | }; | 227 | }; |
| 227 | 228 | ||
| @@ -258,8 +259,8 @@ solve_multicoord( | |||
| 258 | } | 259 | } |
| 259 | 260 | ||
| 260 | /* All coordinates are solved */ | 261 | /* All coordinates are solved */ |
| 261 | if (minmoves == 0 && !appendsolution(&solution_moves, | 262 | if (minmoves == 0 && !appendsolution(&solution_moves, 1, |
| 262 | &solution_settings, &solution_list)) | 263 | &arg.tmask, &solution_settings, &solution_list)) |
| 263 | goto solve_multicoord_error_buffer; | 264 | goto solve_multicoord_error_buffer; |
| 264 | goto solve_multicoord_done; | 265 | goto solve_multicoord_done; |
| 265 | 266 | ||
diff --git a/src/solvers/coord/solve.h b/src/solvers/coord/solve.h index 54309b1..9ea6d1a 100644 --- a/src/solvers/coord/solve.h +++ b/src/solvers/coord/solve.h | |||
| @@ -3,6 +3,7 @@ typedef struct { | |||
| 3 | cube_t inverse; | 3 | cube_t inverse; |
| 4 | uint8_t target_depth; | 4 | uint8_t target_depth; |
| 5 | solution_moves_t *solution_moves; | 5 | solution_moves_t *solution_moves; |
| 6 | uint64_t tmask; | ||
| 6 | solution_settings_t *solution_settings; | 7 | solution_settings_t *solution_settings; |
| 7 | solution_list_t *solution_list; | 8 | solution_list_t *solution_list; |
| 8 | uint8_t nissflag; | 9 | uint8_t nissflag; |
| @@ -163,7 +164,7 @@ solve_coord_dfs(dfsarg_solve_coord_t arg[static 1]) | |||
| 163 | if (coord_is_solved(arg->coord, coord, arg->coord_data)) { | 164 | if (coord_is_solved(arg->coord, coord, arg->coord_data)) { |
| 164 | if (!coord_solution_admissible(arg)) | 165 | if (!coord_solution_admissible(arg)) |
| 165 | return 0; | 166 | return 0; |
| 166 | return appendsolution(arg->solution_moves, | 167 | return appendsolution(arg->solution_moves, 1, &arg->tmask, |
| 167 | arg->solution_settings, arg->solution_list); | 168 | arg->solution_settings, arg->solution_list); |
| 168 | } | 169 | } |
| 169 | 170 | ||
| @@ -339,7 +340,6 @@ solve_coord( | |||
| 339 | solution_moves_reset(&solution_moves); | 340 | solution_moves_reset(&solution_moves); |
| 340 | 341 | ||
| 341 | solution_settings = (solution_settings_t) { | 342 | solution_settings = (solution_settings_t) { |
| 342 | .tmask = TM_SINGLE(inverse_trans(trans)), | ||
| 343 | .unniss = false, | 343 | .unniss = false, |
| 344 | .maxmoves = maxmoves, | 344 | .maxmoves = maxmoves, |
| 345 | .maxsolutions = maxsolutions, | 345 | .maxsolutions = maxsolutions, |
| @@ -355,14 +355,15 @@ solve_coord( | |||
| 355 | .ptable = ptable, | 355 | .ptable = ptable, |
| 356 | .solution_moves = &solution_moves, | 356 | .solution_moves = &solution_moves, |
| 357 | .solution_settings = &solution_settings, | 357 | .solution_settings = &solution_settings, |
| 358 | .tmask = TM_SINGLE(inverse_trans(trans)), | ||
| 358 | .solution_list = &solution_list, | 359 | .solution_list = &solution_list, |
| 359 | .nissflag = nissflag, | 360 | .nissflag = nissflag, |
| 360 | }; | 361 | }; |
| 361 | 362 | ||
| 362 | i = coord->coord(c, coord_data); | 363 | i = coord->coord(c, coord_data); |
| 363 | if (coord_is_solved(coord, i, coord_data)) { | 364 | if (coord_is_solved(coord, i, coord_data)) { |
| 364 | if (minmoves == 0 && !appendsolution(&solution_moves, | 365 | if (minmoves == 0 && !appendsolution(&solution_moves, 1, |
| 365 | &solution_settings, &solution_list)) | 366 | &arg.tmask, &solution_settings, &solution_list)) |
| 366 | goto solve_coord_error_buffer; | 367 | goto solve_coord_error_buffer; |
| 367 | goto solve_coord_done; | 368 | goto solve_coord_done; |
| 368 | } | 369 | } |
