diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-09-10 22:48:30 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-09-10 22:58:21 +0200 |
| commit | 4b5ab5d1808949661b4b449af914f3659596ef73 (patch) | |
| tree | bf583393c9262c96bc244466e042725c7b0745bf /src/solvers/h48/solve.h | |
| parent | 70d3a3de3a2fdef7e47b2bd510261d69390a3a9c (diff) | |
| download | nissy-core-4b5ab5d1808949661b4b449af914f3659596ef73.tar.gz nissy-core-4b5ab5d1808949661b4b449af914f3659596ef73.zip | |
8 bit tables
Diffstat (limited to 'src/solvers/h48/solve.h')
| -rw-r--r-- | src/solvers/h48/solve.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/solvers/h48/solve.h b/src/solvers/h48/solve.h index 88c5a1e..1c9328b 100644 --- a/src/solvers/h48/solve.h +++ b/src/solvers/h48/solve.h | |||
| @@ -9,7 +9,7 @@ typedef struct { | |||
| 9 | uint8_t h; | 9 | uint8_t h; |
| 10 | uint8_t k; | 10 | uint8_t k; |
| 11 | uint32_t *cocsepdata; | 11 | uint32_t *cocsepdata; |
| 12 | uint32_t *h48data; | 12 | uint8_t *h48data; |
| 13 | char **nextsol; | 13 | char **nextsol; |
| 14 | uint8_t nissbranch; | 14 | uint8_t nissbranch; |
| 15 | int8_t npremoves; | 15 | int8_t npremoves; |
| @@ -22,7 +22,7 @@ typedef struct { | |||
| 22 | int8_t depth; | 22 | int8_t depth; |
| 23 | uint8_t moves[MAXLEN]; | 23 | uint8_t moves[MAXLEN]; |
| 24 | uint32_t *cocsepdata; | 24 | uint32_t *cocsepdata; |
| 25 | uint32_t *h48data; | 25 | uint8_t *h48data; |
| 26 | char *s; | 26 | char *s; |
| 27 | } dfsarg_solveh48stats_t; | 27 | } dfsarg_solveh48stats_t; |
| 28 | 28 | ||
| @@ -105,7 +105,6 @@ solve_h48_stop(dfsarg_solveh48_t *arg) | |||
| 105 | return true; | 105 | return true; |
| 106 | 106 | ||
| 107 | bound = get_h48_bound(arg->cube, data, arg->h, arg->k, arg->h48data); | 107 | bound = get_h48_bound(arg->cube, data, arg->h, arg->k, arg->h48data); |
| 108 | // LOG("Using pval %" PRId8 "\n", bound); | ||
| 109 | if (bound + arg->nmoves + arg->npremoves > arg->depth) | 108 | if (bound + arg->nmoves + arg->npremoves > arg->depth) |
| 110 | return true; | 109 | return true; |
| 111 | if (bound + arg->nmoves + arg->npremoves == arg->depth) | 110 | if (bound + arg->nmoves + arg->npremoves == arg->depth) |
| @@ -193,8 +192,8 @@ solve_h48( | |||
| 193 | .maxsolutions = maxsolutions, | 192 | .maxsolutions = maxsolutions, |
| 194 | .h = h, | 193 | .h = h, |
| 195 | .k = k, | 194 | .k = k, |
| 196 | .cocsepdata = (uint32_t *)data, | 195 | .cocsepdata = (uint32_t *)((char *)data + INFOSIZE), |
| 197 | .h48data = ((uint32_t *)data) + COCSEP_FULLSIZE / 4, | 196 | .h48data = (uint8_t *)data + COCSEP_FULLSIZE, |
| 198 | .nextsol = &solutions | 197 | .nextsol = &solutions |
| 199 | }; | 198 | }; |
| 200 | 199 | ||
| @@ -237,7 +236,7 @@ solve_h48stats_dfs(dfsarg_solveh48stats_t *arg) | |||
| 237 | 236 | ||
| 238 | /* Check h48 lower bound for h=0 (esep, but no eo) */ | 237 | /* Check h48 lower bound for h=0 (esep, but no eo) */ |
| 239 | coord = coord_h48_edges(arg->cube, COCLASS(d), TTREP(d), 0); | 238 | coord = coord_h48_edges(arg->cube, COCLASS(d), TTREP(d), 0); |
| 240 | bound = get_esep_pval(arg->h48data, coord, 4); | 239 | bound = get_h48_bound(arg->cube, d, 0, 4, arg->h48data); |
| 241 | if (bound + arg->nmoves > arg->depth) | 240 | if (bound + arg->nmoves > arg->depth) |
| 242 | return 0; | 241 | return 0; |
| 243 | 242 | ||
| @@ -284,8 +283,8 @@ solve_h48stats( | |||
| 284 | 283 | ||
| 285 | arg = (dfsarg_solveh48stats_t) { | 284 | arg = (dfsarg_solveh48stats_t) { |
| 286 | .cube = cube, | 285 | .cube = cube, |
| 287 | .cocsepdata = (uint32_t *)data, | 286 | .cocsepdata = (uint32_t *)((char *)data + INFOSIZE), |
| 288 | .h48data = ((uint32_t *)data) + (cocsepsize/4), | 287 | .h48data = (uint8_t *)data + cocsepsize, |
| 289 | .s = solutions | 288 | .s = solutions |
| 290 | }; | 289 | }; |
| 291 | 290 | ||
