diff options
Diffstat (limited to '')
| -rw-r--r-- | src/solvers/h48/gendata_h48.h | 23 | ||||
| -rw-r--r-- | src/solvers/h48/solve.h | 11 |
2 files changed, 23 insertions, 11 deletions
diff --git a/src/solvers/h48/gendata_h48.h b/src/solvers/h48/gendata_h48.h index 0d7fada..f276eca 100644 --- a/src/solvers/h48/gendata_h48.h +++ b/src/solvers/h48/gendata_h48.h | |||
| @@ -71,10 +71,6 @@ typedef struct { | |||
| 71 | h48map_t *shortcubes; | 71 | h48map_t *shortcubes; |
| 72 | } h48k2_dfs_arg_t; | 72 | } h48k2_dfs_arg_t; |
| 73 | 73 | ||
| 74 | STATIC_INLINE uint8_t get_h48_pval(const uint8_t *, int64_t, uint8_t); | ||
| 75 | STATIC_INLINE void set_h48_pval(uint8_t *, int64_t, uint8_t, uint8_t); | ||
| 76 | STATIC_INLINE uint8_t get_h48_bound(cube_t, uint32_t, uint8_t, uint8_t, uint8_t *); | ||
| 77 | |||
| 78 | STATIC uint64_t gen_h48short(gendata_h48short_arg_t *); | 74 | STATIC uint64_t gen_h48short(gendata_h48short_arg_t *); |
| 79 | STATIC size_t gendata_h48(gendata_h48_arg_t *); | 75 | STATIC size_t gendata_h48(gendata_h48_arg_t *); |
| 80 | STATIC size_t gendata_h48h0k4(gendata_h48_arg_t *); | 76 | STATIC size_t gendata_h48h0k4(gendata_h48_arg_t *); |
| @@ -86,6 +82,13 @@ STATIC_INLINE void gendata_h48k2_mark(cube_t, int8_t, h48k2_dfs_arg_t *); | |||
| 86 | STATIC_INLINE bool gendata_h48k2_dfs_stop(cube_t, uint8_t, h48k2_dfs_arg_t *); | 82 | STATIC_INLINE bool gendata_h48k2_dfs_stop(cube_t, uint8_t, h48k2_dfs_arg_t *); |
| 87 | STATIC void gendata_h48k2_dfs(h48k2_dfs_arg_t *arg); | 83 | STATIC void gendata_h48k2_dfs(h48k2_dfs_arg_t *arg); |
| 88 | 84 | ||
| 85 | STATIC uint32_t *get_cocsepdata_ptr(const void *); | ||
| 86 | STATIC uint8_t *get_h48data_ptr(const void *); | ||
| 87 | |||
| 88 | STATIC_INLINE uint8_t get_h48_pval(const uint8_t *, int64_t, uint8_t); | ||
| 89 | STATIC_INLINE void set_h48_pval(uint8_t *, int64_t, uint8_t, uint8_t); | ||
| 90 | STATIC_INLINE uint8_t get_h48_bound(cube_t, uint32_t, uint8_t, uint8_t, uint8_t *); | ||
| 91 | |||
| 89 | STATIC uint64_t | 92 | STATIC uint64_t |
| 90 | gen_h48short(gendata_h48short_arg_t *arg) | 93 | gen_h48short(gendata_h48short_arg_t *arg) |
| 91 | { | 94 | { |
| @@ -529,3 +532,15 @@ get_h48_bound(cube_t cube, uint32_t cdata, uint8_t h, uint8_t k, uint8_t *table) | |||
| 529 | coord = coord_h48_edges(cube, COCLASS(cdata), TTREP(cdata), h); | 532 | coord = coord_h48_edges(cube, COCLASS(cdata), TTREP(cdata), h); |
| 530 | return get_h48_pval(table, coord, k); | 533 | return get_h48_pval(table, coord, k); |
| 531 | } | 534 | } |
| 535 | |||
| 536 | STATIC uint32_t * | ||
| 537 | get_cocsepdata_ptr(const void *data) | ||
| 538 | { | ||
| 539 | return (uint32_t *)((char *)data + INFOSIZE); | ||
| 540 | } | ||
| 541 | |||
| 542 | STATIC uint8_t * | ||
| 543 | get_h48data_ptr(const void *data) | ||
| 544 | { | ||
| 545 | return (uint8_t *)data + COCSEP_FULLSIZE + INFOSIZE; | ||
| 546 | } | ||
diff --git a/src/solvers/h48/solve.h b/src/solvers/h48/solve.h index 1c9328b..26847b2 100644 --- a/src/solvers/h48/solve.h +++ b/src/solvers/h48/solve.h | |||
| @@ -192,8 +192,8 @@ solve_h48( | |||
| 192 | .maxsolutions = maxsolutions, | 192 | .maxsolutions = maxsolutions, |
| 193 | .h = h, | 193 | .h = h, |
| 194 | .k = k, | 194 | .k = k, |
| 195 | .cocsepdata = (uint32_t *)((char *)data + INFOSIZE), | 195 | .cocsepdata = get_cocsepdata_ptr(data), |
| 196 | .h48data = (uint8_t *)data + COCSEP_FULLSIZE, | 196 | .h48data = get_h48data_ptr(data), |
| 197 | .nextsol = &solutions | 197 | .nextsol = &solutions |
| 198 | }; | 198 | }; |
| 199 | 199 | ||
| @@ -276,15 +276,12 @@ solve_h48stats( | |||
| 276 | ) | 276 | ) |
| 277 | { | 277 | { |
| 278 | int i; | 278 | int i; |
| 279 | size_t cocsepsize; | ||
| 280 | dfsarg_solveh48stats_t arg; | 279 | dfsarg_solveh48stats_t arg; |
| 281 | 280 | ||
| 282 | cocsepsize = gendata_cocsep(NULL, NULL, NULL); | ||
| 283 | |||
| 284 | arg = (dfsarg_solveh48stats_t) { | 281 | arg = (dfsarg_solveh48stats_t) { |
| 285 | .cube = cube, | 282 | .cube = cube, |
| 286 | .cocsepdata = (uint32_t *)((char *)data + INFOSIZE), | 283 | .cocsepdata = get_cocsepdata_ptr(data), |
| 287 | .h48data = (uint8_t *)data + cocsepsize, | 284 | .h48data = get_h48data_ptr(data), |
| 288 | .s = solutions | 285 | .s = solutions |
| 289 | }; | 286 | }; |
| 290 | 287 | ||
