diff options
Diffstat (limited to 'src/solvers/coord/solve.h')
| -rw-r--r-- | src/solvers/coord/solve.h | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/solvers/coord/solve.h b/src/solvers/coord/solve.h index b372257..036c4bf 100644 --- a/src/solvers/coord/solve.h +++ b/src/solvers/coord/solve.h | |||
| @@ -240,7 +240,7 @@ solve_coord_dfs(dfsarg_solve_coord_t arg[static 1]) | |||
| 240 | STATIC long long | 240 | STATIC long long |
| 241 | solve_coord_dispatch( | 241 | solve_coord_dispatch( |
| 242 | oriented_cube_t oc, | 242 | oriented_cube_t oc, |
| 243 | const char *coord_and_axis, | 243 | const char *coord_and_trans, |
| 244 | unsigned nissflag, | 244 | unsigned nissflag, |
| 245 | unsigned minmoves, | 245 | unsigned minmoves, |
| 246 | unsigned maxmoves, | 246 | unsigned maxmoves, |
| @@ -257,22 +257,23 @@ solve_coord_dispatch( | |||
| 257 | ) | 257 | ) |
| 258 | { | 258 | { |
| 259 | coord_t *coord; | 259 | coord_t *coord; |
| 260 | uint8_t axis; | 260 | uint8_t trans; |
| 261 | 261 | ||
| 262 | parse_coord_and_axis(coord_and_axis, &coord, &axis); | 262 | parse_coord_and_trans(coord_and_trans, &coord, &trans); |
| 263 | 263 | ||
| 264 | if (coord == NULL) { | 264 | if (coord == NULL) { |
| 265 | LOG("Error: could not parse coordinate from '%s'\n", | 265 | LOG("Error: could not parse coordinate from '%s'\n", |
| 266 | coord_and_axis); | 266 | coord_and_trans); |
| 267 | return NISSY_ERROR_INVALID_SOLVER; | 267 | return NISSY_ERROR_INVALID_SOLVER; |
| 268 | } | 268 | } |
| 269 | 269 | ||
| 270 | if (axis == UINT8_ERROR) { | 270 | if (trans == UINT8_ERROR) { |
| 271 | LOG("Error: could not parse axis from '%s'\n", coord_and_axis); | 271 | LOG("Error: could not parse transformation from '%s'\n", |
| 272 | coord_and_trans); | ||
| 272 | return NISSY_ERROR_INVALID_SOLVER; | 273 | return NISSY_ERROR_INVALID_SOLVER; |
| 273 | } | 274 | } |
| 274 | 275 | ||
| 275 | return solve_coord(oc, coord, axis, nissflag, minmoves, maxmoves, | 276 | return solve_coord(oc, coord, trans, nissflag, minmoves, maxmoves, |
| 276 | maxsolutions, optimal, threads, data_size, data, | 277 | maxsolutions, optimal, threads, data_size, data, |
| 277 | solutions_size, sols, poll_status, poll_status_data); | 278 | solutions_size, sols, poll_status, poll_status_data); |
| 278 | } | 279 | } |
| @@ -281,7 +282,7 @@ STATIC int64_t | |||
| 281 | solve_coord( | 282 | solve_coord( |
| 282 | oriented_cube_t oc, | 283 | oriented_cube_t oc, |
| 283 | coord_t coord [static 1], | 284 | coord_t coord [static 1], |
| 284 | uint8_t axis, | 285 | uint8_t trans, |
| 285 | uint8_t nissflag, | 286 | uint8_t nissflag, |
| 286 | uint8_t minmoves, | 287 | uint8_t minmoves, |
| 287 | uint8_t maxmoves, | 288 | uint8_t maxmoves, |
| @@ -297,7 +298,6 @@ solve_coord( | |||
| 297 | ) | 298 | ) |
| 298 | { | 299 | { |
| 299 | int8_t d; | 300 | int8_t d; |
| 300 | uint8_t t; | ||
| 301 | uint64_t i; | 301 | uint64_t i; |
| 302 | int64_t err; | 302 | int64_t err; |
| 303 | cube_t c; | 303 | cube_t c; |
| @@ -309,8 +309,7 @@ solve_coord( | |||
| 309 | solution_settings_t solution_settings; | 309 | solution_settings_t solution_settings; |
| 310 | solution_list_t solution_list; | 310 | solution_list_t solution_list; |
| 311 | 311 | ||
| 312 | t = coord->axistrans[axis]; | 312 | c = transform(oc.cube, trans); |
| 313 | c = transform(oc.cube, t); | ||
| 314 | 313 | ||
| 315 | if (!coord->is_solvable(c)) | 314 | if (!coord->is_solvable(c)) |
| 316 | goto solve_coord_error_unsolvable; | 315 | goto solve_coord_error_unsolvable; |
| @@ -334,7 +333,7 @@ solve_coord( | |||
| 334 | solution_moves_reset(&solution_moves); | 333 | solution_moves_reset(&solution_moves); |
| 335 | 334 | ||
| 336 | solution_settings = (solution_settings_t) { | 335 | solution_settings = (solution_settings_t) { |
| 337 | .tmask = TM_SINGLE(inverse_trans(t)), | 336 | .tmask = TM_SINGLE(inverse_trans(trans)), |
| 338 | .unniss = false, | 337 | .unniss = false, |
| 339 | .maxmoves = maxmoves, | 338 | .maxmoves = maxmoves, |
| 340 | .maxsolutions = maxsolutions, | 339 | .maxsolutions = maxsolutions, |
