diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2026-09-17 21:50:34 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2026-09-17 21:50:34 +0200 |
| commit | 1f7e8e937d0e71e7eb3b5deab38b34d0a0159d88 (patch) | |
| tree | 3eddf00f6f44356596b688325d4ef197c0e673e0 /src/solvers/h48 | |
| parent | aa306fa0a2047f30d585da7923f963e8d321aa0b (diff) | |
| download | nissy-core-1f7e8e937d0e71e7eb3b5deab38b34d0a0159d88.tar.gz nissy-core-1f7e8e937d0e71e7eb3b5deab38b34d0a0159d88.zip | |
Added include guardsHEADmasterinclude-guards
Diffstat (limited to 'src/solvers/h48')
| -rw-r--r-- | src/solvers/h48/checkdata.h | 5 | ||||
| -rw-r--r-- | src/solvers/h48/coordinate.h | 5 | ||||
| -rw-r--r-- | src/solvers/h48/coordinate_types_macros.h | 5 | ||||
| -rw-r--r-- | src/solvers/h48/distribution_h48.h | 5 | ||||
| -rw-r--r-- | src/solvers/h48/gendata_cocsep.h | 5 | ||||
| -rw-r--r-- | src/solvers/h48/gendata_eoesep.h | 5 | ||||
| -rw-r--r-- | src/solvers/h48/gendata_h48.h | 5 | ||||
| -rw-r--r-- | src/solvers/h48/gendata_types_macros.h | 5 | ||||
| -rw-r--r-- | src/solvers/h48/h48.h | 5 | ||||
| -rw-r--r-- | src/solvers/h48/map.h | 5 | ||||
| -rw-r--r-- | src/solvers/h48/map_types_macros.h | 5 | ||||
| -rw-r--r-- | src/solvers/h48/solve.h | 5 | ||||
| -rw-r--r-- | src/solvers/h48/utils.h | 5 |
13 files changed, 65 insertions, 0 deletions
diff --git a/src/solvers/h48/checkdata.h b/src/solvers/h48/checkdata.h index 948ac67..e2fa38c 100644 --- a/src/solvers/h48/checkdata.h +++ b/src/solvers/h48/checkdata.h | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | #ifndef SOLVERS_H48_CHECKDATA_H | ||
| 2 | #define SOLVERS_H48_CHECKDATA_H | ||
| 3 | |||
| 1 | STATIC long long checkdata_h48( | 4 | STATIC long long checkdata_h48( |
| 2 | const char *, unsigned long long, const unsigned char *); | 5 | const char *, unsigned long long, const unsigned char *); |
| 3 | 6 | ||
| @@ -194,3 +197,5 @@ checkdata_h48( | |||
| 194 | 197 | ||
| 195 | return NISSY_OK; | 198 | return NISSY_OK; |
| 196 | } | 199 | } |
| 200 | |||
| 201 | #endif /* SOLVERS_H48_CHECKDATA_H */ | ||
diff --git a/src/solvers/h48/coordinate.h b/src/solvers/h48/coordinate.h index 695efc3..acbb9c0 100644 --- a/src/solvers/h48/coordinate.h +++ b/src/solvers/h48/coordinate.h | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | #ifndef SOLVERS_H48_COORDINATE_H | ||
| 2 | #define SOLVERS_H48_COORDINATE_H | ||
| 3 | |||
| 1 | STATIC_INLINE uint64_t coord_h48( | 4 | STATIC_INLINE uint64_t coord_h48( |
| 2 | cube_t, const uint32_t [SIZE(COCSEP_TABLESIZE)], uint8_t); | 5 | cube_t, const uint32_t [SIZE(COCSEP_TABLESIZE)], uint8_t); |
| 3 | STATIC_INLINE uint64_t coord_h48_edges(cube_t, uint64_t, uint8_t, uint8_t); | 6 | STATIC_INLINE uint64_t coord_h48_edges(cube_t, uint64_t, uint8_t, uint8_t); |
| @@ -68,3 +71,5 @@ invcoord_h48( | |||
| 68 | 71 | ||
| 69 | return ret; | 72 | return ret; |
| 70 | } | 73 | } |
| 74 | |||
| 75 | #endif /* SOLVERS_H48_COORDINATE_H */ | ||
diff --git a/src/solvers/h48/coordinate_types_macros.h b/src/solvers/h48/coordinate_types_macros.h index cf24e47..6ddd3e8 100644 --- a/src/solvers/h48/coordinate_types_macros.h +++ b/src/solvers/h48/coordinate_types_macros.h | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | #ifndef SOLVERS_H48_COORDINATE_TYPES_MACROS_H | ||
| 2 | #define SOLVERS_H48_COORDINATE_TYPES_MACROS_H | ||
| 3 | |||
| 1 | #define H48_ESIZE(h) ((COMB_12_4 * COMB_8_4) << (uint64_t)(h)) | 4 | #define H48_ESIZE(h) ((COMB_12_4 * COMB_8_4) << (uint64_t)(h)) |
| 2 | 5 | ||
| 3 | #define COCLASS_MASK (UINT32_C(0xFFFF) << UINT32_C(16)) | 6 | #define COCLASS_MASK (UINT32_C(0xFFFF) << UINT32_C(16)) |
| @@ -5,3 +8,5 @@ | |||
| 5 | #define ECLASS(x) COCLASS(x) | 8 | #define ECLASS(x) COCLASS(x) |
| 6 | #define TTREP_MASK (UINT32_C(0xFF) << UINT32_C(8)) | 9 | #define TTREP_MASK (UINT32_C(0xFF) << UINT32_C(8)) |
| 7 | #define TTREP(x) (((x) & TTREP_MASK) >> UINT32_C(8)) | 10 | #define TTREP(x) (((x) & TTREP_MASK) >> UINT32_C(8)) |
| 11 | |||
| 12 | #endif /* SOLVERS_H48_COORDINATE_TYPES_MACROS_H */ | ||
diff --git a/src/solvers/h48/distribution_h48.h b/src/solvers/h48/distribution_h48.h index 2cb50aa..b7f3811 100644 --- a/src/solvers/h48/distribution_h48.h +++ b/src/solvers/h48/distribution_h48.h | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | #ifndef SOLVERS_H48_DISTRIBUTION_H48_H | ||
| 2 | #define SOLVERS_H48_DISTRIBUTION_H48_H | ||
| 3 | |||
| 1 | /* | 4 | /* |
| 2 | This file is very similar to ../distibution.h, but some adaptations are | 5 | This file is very similar to ../distibution.h, but some adaptations are |
| 3 | needed for H48 because of the intertwined fallback table, and it is easier | 6 | needed for H48 because of the intertwined fallback table, and it is easier |
| @@ -74,3 +77,5 @@ getdistribution_h48( | |||
| 74 | c = H48_LINE_EXT(H48_COORDMAX(info->h48h)) % H48_LINE_ALLCOORDS; | 77 | c = H48_LINE_EXT(H48_COORDMAX(info->h48h)) % H48_LINE_ALLCOORDS; |
| 75 | distr[3] -= H48_LINE_COORDS - c; | 78 | distr[3] -= H48_LINE_COORDS - c; |
| 76 | } | 79 | } |
| 80 | |||
| 81 | #endif /* SOLVERS_H48_DISTRIBUTION_H48_H */ | ||
diff --git a/src/solvers/h48/gendata_cocsep.h b/src/solvers/h48/gendata_cocsep.h index f83207b..1cea52e 100644 --- a/src/solvers/h48/gendata_cocsep.h +++ b/src/solvers/h48/gendata_cocsep.h | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | #ifndef SOLVERS_H48_GENDATA_COCSEP_H | ||
| 2 | #define SOLVERS_H48_GENDATA_COCSEP_H | ||
| 3 | |||
| 1 | STATIC size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); | 4 | STATIC size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); |
| 2 | STATIC uint32_t gendata_cocsep_dfs(cocsep_dfs_arg_t [NON_NULL]); | 5 | STATIC uint32_t gendata_cocsep_dfs(cocsep_dfs_arg_t [NON_NULL]); |
| 3 | 6 | ||
| @@ -164,3 +167,5 @@ get_h48_cdata( | |||
| 164 | 167 | ||
| 165 | return CBOUND(*cdata); | 168 | return CBOUND(*cdata); |
| 166 | } | 169 | } |
| 170 | |||
| 171 | #endif /* SOLVERS_H48_GENDATA_COCSEP_H */ | ||
diff --git a/src/solvers/h48/gendata_eoesep.h b/src/solvers/h48/gendata_eoesep.h index 81bbd43..55097c9 100644 --- a/src/solvers/h48/gendata_eoesep.h +++ b/src/solvers/h48/gendata_eoesep.h | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | #ifndef SOLVERS_H48_GENDATA_EOESEP_H | ||
| 2 | #define SOLVERS_H48_GENDATA_EOESEP_H | ||
| 3 | |||
| 1 | STATIC uint64_t coord_eoesep_sym(cube_t, const uint32_t [SIZE(ESEP_MAX)]); | 4 | STATIC uint64_t coord_eoesep_sym(cube_t, const uint32_t [SIZE(ESEP_MAX)]); |
| 2 | STATIC size_t gendata_esep_classes( | 5 | STATIC size_t gendata_esep_classes( |
| 3 | uint32_t [SIZE(ESEP_MAX)], uint16_t [SIZE(ESEP_CLASSES)]); | 6 | uint32_t [SIZE(ESEP_MAX)], uint16_t [SIZE(ESEP_CLASSES)]); |
| @@ -280,3 +283,5 @@ set_eoesep_pval( | |||
| 280 | table[EOESEP_INDEX(i)] = (table[EOESEP_INDEX(i)] & (~EOESEP_MASK(i))) | 283 | table[EOESEP_INDEX(i)] = (table[EOESEP_INDEX(i)] & (~EOESEP_MASK(i))) |
| 281 | | (val << EOESEP_SHIFT(i)); | 284 | | (val << EOESEP_SHIFT(i)); |
| 282 | } | 285 | } |
| 286 | |||
| 287 | #endif /* SOLVERS_H48_GENDATA_EOESEP_H */ | ||
diff --git a/src/solvers/h48/gendata_h48.h b/src/solvers/h48/gendata_h48.h index 53b1fad..0b85e49 100644 --- a/src/solvers/h48/gendata_h48.h +++ b/src/solvers/h48/gendata_h48.h | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | #ifndef SOLVERS_H48_GENDATA_H48_H | ||
| 2 | #define SOLVERS_H48_GENDATA_H48_H | ||
| 3 | |||
| 1 | STATIC long long gendata_h48_dispatch( | 4 | STATIC long long gendata_h48_dispatch( |
| 2 | const char *, unsigned long long, unsigned char *); | 5 | const char *, unsigned long long, unsigned char *); |
| 3 | STATIC uint64_t gendata_h48short(gendata_h48short_arg_t [NON_NULL]); | 6 | STATIC uint64_t gendata_h48short(gendata_h48short_arg_t [NON_NULL]); |
| @@ -547,3 +550,5 @@ get_h48_pval_and_min( | |||
| 547 | *pval_min = tmin >> UINT8_C(4); | 550 | *pval_min = tmin >> UINT8_C(4); |
| 548 | return (t & H48_MASK(iext)) >> H48_SHIFT(iext); | 551 | return (t & H48_MASK(iext)) >> H48_SHIFT(iext); |
| 549 | } | 552 | } |
| 553 | |||
| 554 | #endif /* SOLVERS_H48_GENDATA_H48_H */ | ||
diff --git a/src/solvers/h48/gendata_types_macros.h b/src/solvers/h48/gendata_types_macros.h index 9bce2c9..e81acc5 100644 --- a/src/solvers/h48/gendata_types_macros.h +++ b/src/solvers/h48/gendata_types_macros.h | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | #ifndef SOLVERS_H48_GENDATA_TYPES_MACROS_H | ||
| 2 | #define SOLVERS_H48_GENDATA_TYPES_MACROS_H | ||
| 3 | |||
| 1 | #define COCSEP_CLASSES ((size_t)3393) | 4 | #define COCSEP_CLASSES ((size_t)3393) |
| 2 | #define COCSEP_TABLESIZE ((size_t)POW_3_7 << (size_t)7) | 5 | #define COCSEP_TABLESIZE ((size_t)POW_3_7 << (size_t)7) |
| 3 | #define COCSEP_VISITEDSIZE DIV_ROUND_UP(COCSEP_TABLESIZE, (size_t)8) | 6 | #define COCSEP_VISITEDSIZE DIV_ROUND_UP(COCSEP_TABLESIZE, (size_t)8) |
| @@ -116,3 +119,5 @@ typedef struct { | |||
| 116 | wrapthread_atomic unsigned char *table_atomic; | 119 | wrapthread_atomic unsigned char *table_atomic; |
| 117 | wrapthread_define_struct_mutex_t(**table_mutex); | 120 | wrapthread_define_struct_mutex_t(**table_mutex); |
| 118 | } gendata_h48_mark_t; | 121 | } gendata_h48_mark_t; |
| 122 | |||
| 123 | #endif /* SOLVERS_H48_GENDATA_TYPES_MACROS_H */ | ||
diff --git a/src/solvers/h48/h48.h b/src/solvers/h48/h48.h index f7ba8b7..e05fc2b 100644 --- a/src/solvers/h48/h48.h +++ b/src/solvers/h48/h48.h | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | #ifndef SOLVERS_H48_H48_H | ||
| 2 | #define SOLVERS_H48_H48_H | ||
| 3 | |||
| 1 | #include "utils.h" | 4 | #include "utils.h" |
| 2 | #include "coordinate_types_macros.h" | 5 | #include "coordinate_types_macros.h" |
| 3 | #include "map_types_macros.h" | 6 | #include "map_types_macros.h" |
| @@ -10,3 +13,5 @@ | |||
| 10 | #include "gendata_h48.h" | 13 | #include "gendata_h48.h" |
| 11 | #include "checkdata.h" | 14 | #include "checkdata.h" |
| 12 | #include "solve.h" | 15 | #include "solve.h" |
| 16 | |||
| 17 | #endif /* SOLVERS_H48_H48_H */ | ||
diff --git a/src/solvers/h48/map.h b/src/solvers/h48/map.h index c9cfb06..75b5236 100644 --- a/src/solvers/h48/map.h +++ b/src/solvers/h48/map.h | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | #ifndef SOLVERS_H48_MAP_H | ||
| 2 | #define SOLVERS_H48_MAP_H | ||
| 3 | |||
| 1 | STATIC void h48map_create(h48map_t [NON_NULL], uint64_t, uint64_t); | 4 | STATIC void h48map_create(h48map_t [NON_NULL], uint64_t, uint64_t); |
| 2 | STATIC void h48map_clear(h48map_t [NON_NULL]); | 5 | STATIC void h48map_clear(h48map_t [NON_NULL]); |
| 3 | STATIC void h48map_destroy(h48map_t [NON_NULL]); | 6 | STATIC void h48map_destroy(h48map_t [NON_NULL]); |
| @@ -82,3 +85,5 @@ h48map_nextkvpair(h48map_t map[NON_NULL], uint64_t p[NON_NULL]) | |||
| 82 | 85 | ||
| 83 | return kv; | 86 | return kv; |
| 84 | } | 87 | } |
| 88 | |||
| 89 | #endif /* SOLVERS_H48_MAP_H */ | ||
diff --git a/src/solvers/h48/map_types_macros.h b/src/solvers/h48/map_types_macros.h index b77c68a..a4e3c75 100644 --- a/src/solvers/h48/map_types_macros.h +++ b/src/solvers/h48/map_types_macros.h | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | #ifndef SOLVERS_H48_MAP_TYPES_MACROS_H | ||
| 2 | #define SOLVERS_H48_MAP_TYPES_MACROS_H | ||
| 3 | |||
| 1 | #define MAP_UNSET UINT64_C(0xFFFFFFFFFFFFFFFF) | 4 | #define MAP_UNSET UINT64_C(0xFFFFFFFFFFFFFFFF) |
| 2 | #define MAP_KEYMASK UINT64_C(0xFFFFFFFFFF) | 5 | #define MAP_KEYMASK UINT64_C(0xFFFFFFFFFF) |
| 3 | #define MAP_KEYSHIFT UINT64_C(40) | 6 | #define MAP_KEYSHIFT UINT64_C(40) |
| @@ -14,3 +17,5 @@ typedef struct { | |||
| 14 | uint64_t key; | 17 | uint64_t key; |
| 15 | uint64_t val; | 18 | uint64_t val; |
| 16 | } kvpair_t; | 19 | } kvpair_t; |
| 20 | |||
| 21 | #endif /* SOLVERS_H48_MAP_TYPES_MACROS_H */ | ||
diff --git a/src/solvers/h48/solve.h b/src/solvers/h48/solve.h index ebc5208..36fefa1 100644 --- a/src/solvers/h48/solve.h +++ b/src/solvers/h48/solve.h | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | #ifndef SOLVERS_H48_SOLVE_H | ||
| 2 | #define SOLVERS_H48_SOLVE_H | ||
| 3 | |||
| 1 | #define H48_STARTING_MOVES 4 | 4 | #define H48_STARTING_MOVES 4 |
| 2 | #define H48_STARTING_CUBES 43254 | 5 | #define H48_STARTING_CUBES 43254 |
| 3 | #define H48_SORT_TASKS_MIN_DEPTH 16 | 6 | #define H48_SORT_TASKS_MIN_DEPTH 16 |
| @@ -758,3 +761,5 @@ solve_h48_error_data: | |||
| 758 | solve_h48_error_solutions_buffer: | 761 | solve_h48_error_solutions_buffer: |
| 759 | return NISSY_ERROR_BUFFER_SIZE; | 762 | return NISSY_ERROR_BUFFER_SIZE; |
| 760 | } | 763 | } |
| 764 | |||
| 765 | #endif /* SOLVERS_H48_SOLVE_H */ | ||
diff --git a/src/solvers/h48/utils.h b/src/solvers/h48/utils.h index 6d91108..81c6451 100644 --- a/src/solvers/h48/utils.h +++ b/src/solvers/h48/utils.h | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | #ifndef SOLVERS_H48_UTILS_H | ||
| 2 | #define SOLVERS_H48_UTILS_H | ||
| 3 | |||
| 1 | #if SIZE_MAX == UINT64_MAX | 4 | #if SIZE_MAX == UINT64_MAX |
| 2 | #define H48_HMAX UINT8_C(11) | 5 | #define H48_HMAX UINT8_C(11) |
| 3 | #else | 6 | #else |
| @@ -63,3 +66,5 @@ dataid_h48(const char *str, char buf[SIZE(NISSY_SIZE_DATAID)]) | |||
| 63 | sprintf(buf, "h48h%" PRIu8, h); | 66 | sprintf(buf, "h48h%" PRIu8, h); |
| 64 | return NISSY_OK; | 67 | return NISSY_OK; |
| 65 | } | 68 | } |
| 69 | |||
| 70 | #endif /* SOLVERS_H48_UTILS_H */ | ||
