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/nissy.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/nissy.h') diff --git a/src/nissy.h b/src/nissy.h index b13f417..c23f338 100644 --- a/src/nissy.h +++ b/src/nissy.h @@ -360,8 +360,7 @@ Parameters: minmoves - The minimum number of moves for a solution. maxmoves - The maximum number of moves for a solution. maxsols - The maximum number of solutions. - optimal - If set to a non-negative value, the maximum number of moves - above the optimal solution length. + optimal - The maximum number of moves above the optimal solution length. threads - The number of threads to use. Must be less than or equalt to the value of the compile-time constant THREADS. If set to 0, the default value THREADS will be used. @@ -393,8 +392,8 @@ nissy_solve( unsigned minmoves, unsigned maxmoves, unsigned maxsolutions, - int optimal, - int threads, + unsigned optimal, + unsigned threads, unsigned long long data_size, const char data[data_size], unsigned sols_size, -- cgit v1.3