From 0ece4b72db22139db51e8f5f37c25f24c84f3e43 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Thu, 17 Apr 2025 10:50:57 +0200 Subject: Small rework of optimal vs maxsols I wanted to make the "optimal" and "maxsolutions" options mutually exclusive, but in the end I decided there is value in keeping both (e.g. for specifying a limit to the number of solutions when asking for "all" optimal"). Now optimal cannot be negative anymore, for the same reason of maxsolutions. The interface user (shell, UI) will have to take care of handling this in a way that makes sense for the user. Usually this means setting the maximum number of solutions to UINT_MAX (or a similar very high number) when the user wants "all optimal". --- src/solvers/coord/solve.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/solvers/coord') diff --git a/src/solvers/coord/solve.h b/src/solvers/coord/solve.h index 464f7bd..b289e3f 100644 --- a/src/solvers/coord/solve.h +++ b/src/solvers/coord/solve.h @@ -13,10 +13,11 @@ typedef struct { } dfsarg_solve_coord_t; STATIC int64_t solve_coord(cube_t, coord_t [static 1], uint8_t, uint8_t, - uint8_t, uint8_t, uint64_t, int8_t, int, uint64_t, const void *, + uint8_t, uint8_t, uint64_t, uint8_t, uint8_t, uint64_t, const void *, size_t n, char [n]); STATIC int64_t solve_coord_dispatch(cube_t, const char *, uint8_t, uint8_t, - uint8_t, uint64_t, int8_t, int, uint64_t, const void *, size_t n, char [n]); + uint8_t, uint64_t, uint8_t, uint8_t, uint64_t, const void *, size_t n, + char [n]); STATIC bool coord_solution_admissible(const dfsarg_solve_coord_t [static 1]); STATIC bool solve_coord_dfs_stop(const dfsarg_solve_coord_t [static 1]); STATIC bool coord_continue_onnormal(const dfsarg_solve_coord_t [static 1]); @@ -204,8 +205,8 @@ solve_coord_dispatch( uint8_t minmoves, uint8_t maxmoves, uint64_t maxsolutions, - int8_t optimal, - int threads, + uint8_t optimal, + uint8_t threads, uint64_t data_size, const void *data, size_t solutions_size, @@ -242,8 +243,8 @@ solve_coord( uint8_t minmoves, uint8_t maxmoves, uint64_t maxsolutions, - int8_t optimal, - int threads, + uint8_t optimal, + uint8_t threads, uint64_t data_size, const void *data, size_t solutions_size, -- cgit v1.3