aboutsummaryrefslogtreecommitdiff
path: root/src/nissy.c
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-12-15 09:49:53 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2024-12-15 09:49:53 +0100
commitd2eb169c675101a64fb873a289fad1d4fe70c5e5 (patch)
tree685f2d41d80b693d7641c2ae64fc3a0a3e4f19e5 /src/nissy.c
parent4a88a686d5e08404080ed6954b70c0db252aa220 (diff)
downloadnissy-core-d2eb169c675101a64fb873a289fad1d4fe70c5e5.tar.gz
nissy-core-d2eb169c675101a64fb873a289fad1d4fe70c5e5.zip
Implemented 'optimal' option
Diffstat (limited to '')
-rw-r--r--src/nissy.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nissy.c b/src/nissy.c
index 5d009ba..c21abc0 100644
--- a/src/nissy.c
+++ b/src/nissy.c
@@ -500,7 +500,7 @@ nissy_solve(
500 cube_t c; 500 cube_t c;
501 long long parse_ret; 501 long long parse_ret;
502 uint8_t h, k; 502 uint8_t h, k;
503 int t; 503 int t, opt;
504 504
505 if (solver == NULL) { 505 if (solver == NULL) {
506 LOG("Error: 'solver' argument is NULL\n"); 506 LOG("Error: 'solver' argument is NULL\n");
@@ -524,6 +524,8 @@ nissy_solve(
524 return 0; 524 return 0;
525 } 525 }
526 526
527 opt = optimal < 0 ? MAXLEN : optimal;
528
527 t = threads == 0 ? THREADS : threads; 529 t = threads == 0 ? THREADS : threads;
528 if (t < 0) { 530 if (t < 0) {
529 LOG("solve: 'threads' is negative. Please provide a " 531 LOG("solve: 'threads' is negative. Please provide a "
@@ -539,8 +541,8 @@ nissy_solve(
539 if (!strncmp(solver, "h48", 3)) { 541 if (!strncmp(solver, "h48", 3)) {
540 parse_ret = parse_h48_solver(solver, &h, &k); 542 parse_ret = parse_h48_solver(solver, &h, &k);
541 if (parse_ret == NISSY_OK) 543 if (parse_ret == NISSY_OK)
542 return solve_h48(c, minmoves, maxmoves, maxsols, t, 544 return solve_h48(c, minmoves, maxmoves, maxsols, opt,
543 data_size, data, sols_size, sols, stats); 545 t, data_size, data, sols_size, sols, stats);
544 else 546 else
545 return parse_ret; 547 return parse_ret;
546 } else { 548 } else {

Generated with cgit - Back to sebastiano.tronto.net