aboutsummaryrefslogtreecommitdiff
path: root/src/solvers/h48/solve.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-12-14 15:12:36 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2025-12-14 16:09:31 +0100
commitbcd52547af58b15868e24f3904e307548d1fd505 (patch)
treecda0a871f65575bb15fb4536c7b103c13caf433e /src/solvers/h48/solve.h
parent21fdf9697ddfab0a9c082a91ae0a79b1b574774c (diff)
downloadnissy-core-bcd52547af58b15868e24f3904e307548d1fd505.tar.gz
nissy-core-bcd52547af58b15868e24f3904e307548d1fd505.zip
Cleanup, update documentation, fix examples
Diffstat (limited to 'src/solvers/h48/solve.h')
-rw-r--r--src/solvers/h48/solve.h20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/solvers/h48/solve.h b/src/solvers/h48/solve.h
index 047d13e..8ac596d 100644
--- a/src/solvers/h48/solve.h
+++ b/src/solvers/h48/solve.h
@@ -30,7 +30,6 @@ typedef struct {
30 bool use_lb_normal; 30 bool use_lb_normal;
31 bool use_lb_inverse; 31 bool use_lb_inverse;
32 uint8_t h; 32 uint8_t h;
33 uint8_t k;
34 uint8_t base; 33 uint8_t base;
35 const uint32_t *cocsepdata; 34 const uint32_t *cocsepdata;
36 const unsigned char *h48data; 35 const unsigned char *h48data;
@@ -93,10 +92,10 @@ STATIC long long solve_h48_dispatch(
93 void *poll_status_data 92 void *poll_status_data
94) 93)
95{ 94{
96 uint8_t h, k; 95 uint8_t h;
97 long long err; 96 long long err;
98 97
99 err = parse_h48_hk(solver, &h, &k); 98 err = parse_h48h(solver, &h);
100 if (err != NISSY_OK) 99 if (err != NISSY_OK)
101 return err; 100 return err;
102 101
@@ -142,15 +141,14 @@ solve_h48_stop(dfsarg_solve_h48_t arg[static 1])
142 coord = coord_h48_edges( 141 coord = coord_h48_edges(
143 arg->inverse, COCLASS(data_inv), TTREP(data_inv), arg->h); 142 arg->inverse, COCLASS(data_inv), TTREP(data_inv), arg->h);
144 coordext = H48_LINE_EXT(coord); 143 coordext = H48_LINE_EXT(coord);
145 arg->lb_inverse = get_h48_pval(arg->h48data, coordext, arg->k); 144 arg->lb_inverse = get_h48_pval(arg->h48data, coordext);
146 arg->table_lookups++; 145 arg->table_lookups++;
147 146
148 if (arg->k == 2 && arg->lb_inverse == 0) { 147 if (arg->lb_inverse == 0) {
149 arg->table_fallbacks++; 148 arg->table_fallbacks++;
150 149
151 coordmin = H48_LINE_MIN(coord); 150 coordmin = H48_LINE_MIN(coord);
152 pval_min = get_h48_pvalmin( 151 pval_min = get_h48_pvalmin(arg->h48data, coordmin);
153 arg->h48data, coordmin, arg->k);
154 pval_eoesep = get_eoesep_pval_cube( 152 pval_eoesep = get_eoesep_pval_cube(
155 arg->h48data_fallback_eoesep, arg->inverse); 153 arg->h48data_fallback_eoesep, arg->inverse);
156 arg->lb_inverse = MAX(pval_min, pval_eoesep); 154 arg->lb_inverse = MAX(pval_min, pval_eoesep);
@@ -172,15 +170,14 @@ solve_h48_stop(dfsarg_solve_h48_t arg[static 1])
172 coord = coord_h48_edges( 170 coord = coord_h48_edges(
173 arg->cube, COCLASS(data), TTREP(data), arg->h); 171 arg->cube, COCLASS(data), TTREP(data), arg->h);
174 coordext = H48_LINE_EXT(coord); 172 coordext = H48_LINE_EXT(coord);
175 arg->lb_normal = get_h48_pval(arg->h48data, coordext, arg->k); 173 arg->lb_normal = get_h48_pval(arg->h48data, coordext);
176 arg->table_lookups++; 174 arg->table_lookups++;
177 175
178 if (arg->k == 2 && arg->lb_normal == 0) { 176 if (arg->lb_normal == 0) {
179 arg->table_fallbacks++; 177 arg->table_fallbacks++;
180 178
181 coordmin = H48_LINE_MIN(coord); 179 coordmin = H48_LINE_MIN(coord);
182 pval_min = get_h48_pval( 180 pval_min = get_h48_pval(arg->h48data, coordmin);
183 arg->h48data, coordmin, arg->k);
184 pval_eoesep = get_eoesep_pval_cube( 181 pval_eoesep = get_eoesep_pval_cube(
185 arg->h48data_fallback_eoesep, arg->cube); 182 arg->h48data_fallback_eoesep, arg->cube);
186 arg->lb_normal = MAX(pval_min, pval_eoesep); 183 arg->lb_normal = MAX(pval_min, pval_eoesep);
@@ -515,7 +512,6 @@ solve_h48(
515 .start_cube = oc.cube, 512 .start_cube = oc.cube,
516 .cube = oc.cube, 513 .cube = oc.cube,
517 .h = info.h48h, 514 .h = info.h48h,
518 .k = info.bits,
519 .base = info.base, 515 .base = info.base,
520 .cocsepdata = cocsepdata, 516 .cocsepdata = cocsepdata,
521 .h48data = h48data, 517 .h48data = h48data,

Generated with cgit - Back to sebastiano.tronto.net