aboutsummaryrefslogtreecommitdiff
path: root/src/solvers/h48
diff options
context:
space:
mode:
Diffstat (limited to 'src/solvers/h48')
-rw-r--r--src/solvers/h48/gendata_h48.h3
-rw-r--r--src/solvers/h48/solve.h14
2 files changed, 11 insertions, 6 deletions
diff --git a/src/solvers/h48/gendata_h48.h b/src/solvers/h48/gendata_h48.h
index f276eca..066c650 100644
--- a/src/solvers/h48/gendata_h48.h
+++ b/src/solvers/h48/gendata_h48.h
@@ -152,13 +152,14 @@ gendata_h48(gendata_h48_arg_t *arg)
152 goto gendata_h48_error; 152 goto gendata_h48_error;
153 } 153 }
154 154
155 if (arg->buf == 0) 155 if (arg->buf == NULL)
156 goto gendata_h48_return_size; 156 goto gendata_h48_return_size;
157 157
158 if (!readtableinfo(arg->buf, &cocsepinfo)) { 158 if (!readtableinfo(arg->buf, &cocsepinfo)) {
159 LOG("gendata_h48: could not read info for cocsep table\n"); 159 LOG("gendata_h48: could not read info for cocsep table\n");
160 goto gendata_h48_error; 160 goto gendata_h48_error;
161 } 161 }
162
162 cocsepinfo.next = cocsepsize; 163 cocsepinfo.next = cocsepsize;
163 if (!writetableinfo(&cocsepinfo, arg->buf)) { 164 if (!writetableinfo(&cocsepinfo, arg->buf)) {
164 LOG("gendata_h48: could not write info for cocsep table" 165 LOG("gendata_h48: could not write info for cocsep table"
diff --git a/src/solvers/h48/solve.h b/src/solvers/h48/solve.h
index 26847b2..4bf55ca 100644
--- a/src/solvers/h48/solve.h
+++ b/src/solvers/h48/solve.h
@@ -31,7 +31,7 @@ STATIC uint32_t allowednextmove_h48(uint8_t *, uint8_t, uint32_t);
31STATIC void solve_h48_appendsolution(dfsarg_solveh48_t *); 31STATIC void solve_h48_appendsolution(dfsarg_solveh48_t *);
32STATIC_INLINE bool solve_h48_stop(dfsarg_solveh48_t *); 32STATIC_INLINE bool solve_h48_stop(dfsarg_solveh48_t *);
33STATIC int64_t solve_h48_dfs(dfsarg_solveh48_t *); 33STATIC int64_t solve_h48_dfs(dfsarg_solveh48_t *);
34STATIC int64_t solve_h48(cube_t, int8_t, int8_t, int8_t, uint8_t, uint8_t, const void *, char *); 34STATIC int64_t solve_h48(cube_t, int8_t, int8_t, int8_t, const void *, char *);
35 35
36STATIC int64_t solve_h48stats_dfs(dfsarg_solveh48stats_t *); 36STATIC int64_t solve_h48stats_dfs(dfsarg_solveh48stats_t *);
37STATIC int64_t solve_h48stats(cube_t, int8_t, const void *, char [static 12]); 37STATIC int64_t solve_h48stats(cube_t, int8_t, const void *, char [static 12]);
@@ -176,22 +176,26 @@ solve_h48(
176 int8_t minmoves, 176 int8_t minmoves,
177 int8_t maxmoves, 177 int8_t maxmoves,
178 int8_t maxsolutions, 178 int8_t maxsolutions,
179 uint8_t h,
180 uint8_t k,
181 const void *data, 179 const void *data,
182 char *solutions 180 char *solutions
183) 181)
184{ 182{
185 int64_t nsols; 183 int64_t nsols;
186 dfsarg_solveh48_t arg; 184 dfsarg_solveh48_t arg;
185 tableinfo_t info;
186
187 if(!readtableinfo_n(data, 2, &info)) {
188 LOG("solve_h48: error reading table\n");
189 return 0;
190 }
187 191
188 arg = (dfsarg_solveh48_t) { 192 arg = (dfsarg_solveh48_t) {
189 .cube = cube, 193 .cube = cube,
190 .inverse = inverse(cube), 194 .inverse = inverse(cube),
191 .nsols = &nsols, 195 .nsols = &nsols,
192 .maxsolutions = maxsolutions, 196 .maxsolutions = maxsolutions,
193 .h = h, 197 .h = info.h48h,
194 .k = k, 198 .k = info.bits,
195 .cocsepdata = get_cocsepdata_ptr(data), 199 .cocsepdata = get_cocsepdata_ptr(data),
196 .h48data = get_h48data_ptr(data), 200 .h48data = get_h48data_ptr(data),
197 .nextsol = &solutions 201 .nextsol = &solutions

Generated with cgit - Back to sebastiano.tronto.net