aboutsummaryrefslogtreecommitdiff
path: root/src/solvers/h48/solve_multithread.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-10-14 00:05:43 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-10-14 14:45:22 +0200
commit8a91354f7b94c669c77fe628a81f9bfe9f599ef0 (patch)
treeba29a8b0416cb3464b49fd7cfb69e7f407b892c8 /src/solvers/h48/solve_multithread.h
parent7dbd34574f629cacf3b89292d2a06ad0ae612f26 (diff)
downloadnissy-core-8a91354f7b94c669c77fe628a81f9bfe9f599ef0.tar.gz
nissy-core-8a91354f7b94c669c77fe628a81f9bfe9f599ef0.zip
Interface changes, progress with python
Diffstat (limited to 'src/solvers/h48/solve_multithread.h')
-rw-r--r--src/solvers/h48/solve_multithread.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/solvers/h48/solve_multithread.h b/src/solvers/h48/solve_multithread.h
index 8e00404..d8c81af 100644
--- a/src/solvers/h48/solve_multithread.h
+++ b/src/solvers/h48/solve_multithread.h
@@ -36,13 +36,14 @@ solve_h48_appendsolution_thread(dfsarg_solveh48_t *arg, task_queue_t *tq)
36 36
37 if (strl < 0) 37 if (strl < 0)
38 goto solve_h48_appendsolution_thread_error; 38 goto solve_h48_appendsolution_thread_error;
39 *arg->nextsol += strl; 39 *arg->nextsol += strl-1;
40 arg->solutions_size -= strl; 40 arg->solutions_size -= strl-1;
41 41
42 if (arg->npremoves) 42 if (arg->npremoves)
43 { 43 {
44 **arg->nextsol = ' '; 44 **arg->nextsol = ' ';
45 (*arg->nextsol)++; 45 (*arg->nextsol)++;
46 arg->solutions_size--;
46 47
47 invertmoves(arg->premoves, arg->npremoves, invertedpremoves); 48 invertmoves(arg->premoves, arg->npremoves, invertedpremoves);
48 strl = writemoves(invertedpremoves, 49 strl = writemoves(invertedpremoves,
@@ -50,13 +51,14 @@ solve_h48_appendsolution_thread(dfsarg_solveh48_t *arg, task_queue_t *tq)
50 51
51 if (strl < 0) 52 if (strl < 0)
52 goto solve_h48_appendsolution_thread_error; 53 goto solve_h48_appendsolution_thread_error;
53 *arg->nextsol += strl; 54 *arg->nextsol += strl-1;
54 arg->solutions_size -= strl; 55 arg->solutions_size -= strl-1;
55 } 56 }
56 LOG("Solution found: %s\n", solution); 57 LOG("Solution found: %s\n", solution);
57 58
58 **arg->nextsol = '\n'; 59 **arg->nextsol = '\n';
59 (*arg->nextsol)++; 60 (*arg->nextsol)++;
61 arg->solutions_size--;
60 (*arg->nsols)++; 62 (*arg->nsols)++;
61 63
62solve_h48_appendsolution_thread_error: 64solve_h48_appendsolution_thread_error:

Generated with cgit - Back to sebastiano.tronto.net