From dd6078288b5d7af4a4c0cdd1377a2976af569c9a Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Wed, 11 Sep 2024 10:25:39 +0200 Subject: Better way to read tables for solver --- src/solvers/h48/gendata_h48.h | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'src/solvers/h48/gendata_h48.h') 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 { h48map_t *shortcubes; } h48k2_dfs_arg_t; -STATIC_INLINE uint8_t get_h48_pval(const uint8_t *, int64_t, uint8_t); -STATIC_INLINE void set_h48_pval(uint8_t *, int64_t, uint8_t, uint8_t); -STATIC_INLINE uint8_t get_h48_bound(cube_t, uint32_t, uint8_t, uint8_t, uint8_t *); - STATIC uint64_t gen_h48short(gendata_h48short_arg_t *); STATIC size_t gendata_h48(gendata_h48_arg_t *); 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 *); STATIC_INLINE bool gendata_h48k2_dfs_stop(cube_t, uint8_t, h48k2_dfs_arg_t *); STATIC void gendata_h48k2_dfs(h48k2_dfs_arg_t *arg); +STATIC uint32_t *get_cocsepdata_ptr(const void *); +STATIC uint8_t *get_h48data_ptr(const void *); + +STATIC_INLINE uint8_t get_h48_pval(const uint8_t *, int64_t, uint8_t); +STATIC_INLINE void set_h48_pval(uint8_t *, int64_t, uint8_t, uint8_t); +STATIC_INLINE uint8_t get_h48_bound(cube_t, uint32_t, uint8_t, uint8_t, uint8_t *); + STATIC uint64_t gen_h48short(gendata_h48short_arg_t *arg) { @@ -529,3 +532,15 @@ get_h48_bound(cube_t cube, uint32_t cdata, uint8_t h, uint8_t k, uint8_t *table) coord = coord_h48_edges(cube, COCLASS(cdata), TTREP(cdata), h); return get_h48_pval(table, coord, k); } + +STATIC uint32_t * +get_cocsepdata_ptr(const void *data) +{ + return (uint32_t *)((char *)data + INFOSIZE); +} + +STATIC uint8_t * +get_h48data_ptr(const void *data) +{ + return (uint8_t *)data + COCSEP_FULLSIZE + INFOSIZE; +} -- cgit v1.3