aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/solvers/h48/gendata_h48.h23
-rw-r--r--src/solvers/h48/solve.h11
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
74STATIC_INLINE uint8_t get_h48_pval(const uint8_t *, int64_t, uint8_t);
75STATIC_INLINE void set_h48_pval(uint8_t *, int64_t, uint8_t, uint8_t);
76STATIC_INLINE uint8_t get_h48_bound(cube_t, uint32_t, uint8_t, uint8_t, uint8_t *);
77
78STATIC uint64_t gen_h48short(gendata_h48short_arg_t *); 74STATIC uint64_t gen_h48short(gendata_h48short_arg_t *);
79STATIC size_t gendata_h48(gendata_h48_arg_t *); 75STATIC size_t gendata_h48(gendata_h48_arg_t *);
80STATIC size_t gendata_h48h0k4(gendata_h48_arg_t *); 76STATIC 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 *);
86STATIC_INLINE bool gendata_h48k2_dfs_stop(cube_t, uint8_t, h48k2_dfs_arg_t *); 82STATIC_INLINE bool gendata_h48k2_dfs_stop(cube_t, uint8_t, h48k2_dfs_arg_t *);
87STATIC void gendata_h48k2_dfs(h48k2_dfs_arg_t *arg); 83STATIC void gendata_h48k2_dfs(h48k2_dfs_arg_t *arg);
88 84
85STATIC uint32_t *get_cocsepdata_ptr(const void *);
86STATIC uint8_t *get_h48data_ptr(const void *);
87
88STATIC_INLINE uint8_t get_h48_pval(const uint8_t *, int64_t, uint8_t);
89STATIC_INLINE void set_h48_pval(uint8_t *, int64_t, uint8_t, uint8_t);
90STATIC_INLINE uint8_t get_h48_bound(cube_t, uint32_t, uint8_t, uint8_t, uint8_t *);
91
89STATIC uint64_t 92STATIC uint64_t
90gen_h48short(gendata_h48short_arg_t *arg) 93gen_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
536STATIC uint32_t *
537get_cocsepdata_ptr(const void *data)
538{
539 return (uint32_t *)((char *)data + INFOSIZE);
540}
541
542STATIC uint8_t *
543get_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

Generated with cgit - Back to sebastiano.tronto.net