diff options
Diffstat (limited to 'src/solvers/h48')
| -rw-r--r-- | src/solvers/h48/gendata_cocsep.h | 12 | ||||
| -rw-r--r-- | src/solvers/h48/gendata_h48.h | 24 |
2 files changed, 35 insertions, 1 deletions
diff --git a/src/solvers/h48/gendata_cocsep.h b/src/solvers/h48/gendata_cocsep.h index 2189145..262793b 100644 --- a/src/solvers/h48/gendata_cocsep.h +++ b/src/solvers/h48/gendata_cocsep.h | |||
| @@ -25,6 +25,7 @@ STATIC_INLINE void set_visited(uint8_t *, int64_t); | |||
| 25 | 25 | ||
| 26 | STATIC size_t gendata_cocsep(void *, uint64_t *, cube_t *); | 26 | STATIC size_t gendata_cocsep(void *, uint64_t *, cube_t *); |
| 27 | STATIC uint32_t gendata_cocsep_dfs(cocsep_dfs_arg_t *); | 27 | STATIC uint32_t gendata_cocsep_dfs(cocsep_dfs_arg_t *); |
| 28 | STATIC void getdistribution_cocsep(const uint32_t *, uint64_t [static 21]); | ||
| 28 | 29 | ||
| 29 | STATIC_INLINE int8_t get_h48_cdata(cube_t, uint32_t *, uint32_t *); | 30 | STATIC_INLINE int8_t get_h48_cdata(cube_t, uint32_t *, uint32_t *); |
| 30 | 31 | ||
| @@ -157,6 +158,17 @@ gendata_cocsep_dfs(cocsep_dfs_arg_t *arg) | |||
| 157 | return cc; | 158 | return cc; |
| 158 | } | 159 | } |
| 159 | 160 | ||
| 161 | STATIC void | ||
| 162 | getdistribution_cocsep(const uint32_t *table, uint64_t distr[static 21]) | ||
| 163 | { | ||
| 164 | size_t i; | ||
| 165 | |||
| 166 | memset(distr, 0, 21 * sizeof(uint64_t)); | ||
| 167 | |||
| 168 | for (i = 0; i < COCSEP_TABLESIZE; i++) | ||
| 169 | distr[CBOUND(table[i])]++; | ||
| 170 | } | ||
| 171 | |||
| 160 | STATIC_INLINE bool | 172 | STATIC_INLINE bool |
| 161 | get_visited(const uint8_t *a, int64_t i) | 173 | get_visited(const uint8_t *a, int64_t i) |
| 162 | { | 174 | { |
diff --git a/src/solvers/h48/gendata_h48.h b/src/solvers/h48/gendata_h48.h index 3445570..6e7b0ca 100644 --- a/src/solvers/h48/gendata_h48.h +++ b/src/solvers/h48/gendata_h48.h | |||
| @@ -104,13 +104,16 @@ STATIC size_t gendata_h48k2_realcoord(gendata_h48_arg_t *); | |||
| 104 | STATIC void gendata_h48k2_dfs(h48k2_dfs_arg_t *arg); | 104 | STATIC void gendata_h48k2_dfs(h48k2_dfs_arg_t *arg); |
| 105 | STATIC void * gendata_h48k2_runthread(void *); | 105 | STATIC void * gendata_h48k2_runthread(void *); |
| 106 | STATIC tableinfo_t makeinfo_h48k2(gendata_h48_arg_t *, uint8_t); | 106 | STATIC tableinfo_t makeinfo_h48k2(gendata_h48_arg_t *, uint8_t); |
| 107 | STATIC void getdistribution_h48( | ||
| 108 | const uint8_t *, uint64_t [static 21], uint8_t, uint8_t); | ||
| 107 | 109 | ||
| 108 | STATIC uint32_t *get_cocsepdata_ptr(const void *); | 110 | STATIC uint32_t *get_cocsepdata_ptr(const void *); |
| 109 | STATIC uint8_t *get_h48data_ptr(const void *); | 111 | STATIC uint8_t *get_h48data_ptr(const void *); |
| 110 | 112 | ||
| 111 | STATIC_INLINE uint8_t get_h48_pval(const uint8_t *, int64_t, uint8_t); | 113 | STATIC_INLINE uint8_t get_h48_pval(const uint8_t *, int64_t, uint8_t); |
| 112 | STATIC_INLINE void set_h48_pval(uint8_t *, int64_t, uint8_t, uint8_t); | 114 | STATIC_INLINE void set_h48_pval(uint8_t *, int64_t, uint8_t, uint8_t); |
| 113 | STATIC_INLINE uint8_t get_h48_bound(cube_t, uint32_t, uint8_t, uint8_t, uint8_t *); | 115 | STATIC_INLINE uint8_t get_h48_bound( |
| 116 | cube_t, uint32_t, uint8_t, uint8_t, uint8_t *); | ||
| 114 | 117 | ||
| 115 | STATIC uint64_t | 118 | STATIC uint64_t |
| 116 | gendata_h48short(gendata_h48short_arg_t *arg) | 119 | gendata_h48short(gendata_h48short_arg_t *arg) |
| @@ -662,6 +665,25 @@ makeinfo_h48k2(gendata_h48_arg_t *arg, uint8_t base) | |||
| 662 | return info; | 665 | return info; |
| 663 | } | 666 | } |
| 664 | 667 | ||
| 668 | STATIC void | ||
| 669 | getdistribution_h48( | ||
| 670 | const uint8_t *table, | ||
| 671 | uint64_t distr[static 21], | ||
| 672 | uint8_t h, | ||
| 673 | uint8_t k | ||
| 674 | ) { | ||
| 675 | uint8_t val; | ||
| 676 | int64_t i, h48max; | ||
| 677 | |||
| 678 | memset(distr, 0, 21 * sizeof(uint64_t)); | ||
| 679 | |||
| 680 | h48max = H48_COORDMAX(h); | ||
| 681 | for (i = 0; i < h48max; i++) { | ||
| 682 | val = get_h48_pval(table, i, k); | ||
| 683 | distr[val]++; | ||
| 684 | } | ||
| 685 | } | ||
| 686 | |||
| 665 | STATIC uint32_t * | 687 | STATIC uint32_t * |
| 666 | get_cocsepdata_ptr(const void *data) | 688 | get_cocsepdata_ptr(const void *data) |
| 667 | { | 689 | { |
