aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/solvers/h48/gendata_h48.h16
-rw-r--r--src/solvers/h48/solve.h16
-rw-r--r--src/solvers/h48/stats.h2
3 files changed, 11 insertions, 23 deletions
diff --git a/src/solvers/h48/gendata_h48.h b/src/solvers/h48/gendata_h48.h
index 4400011..55c4f34 100644
--- a/src/solvers/h48/gendata_h48.h
+++ b/src/solvers/h48/gendata_h48.h
@@ -24,8 +24,6 @@ STATIC_INLINE uint8_t get_h48_pval_atomic(
24 _Atomic const uint8_t *, int64_t, uint8_t); 24 _Atomic const uint8_t *, int64_t, uint8_t);
25STATIC_INLINE void set_h48_pval_atomic( 25STATIC_INLINE void set_h48_pval_atomic(
26 _Atomic uint8_t *, int64_t, uint8_t, uint8_t); 26 _Atomic uint8_t *, int64_t, uint8_t, uint8_t);
27STATIC_INLINE uint8_t get_h48_bound(
28 cube_t, uint32_t, uint8_t, uint8_t, const uint8_t *);
29 27
30size_t gendata_h48_derive(uint8_t, const void *, void *); 28size_t gendata_h48_derive(uint8_t, const void *, void *);
31 29
@@ -686,20 +684,6 @@ set_h48_pval_atomic(_Atomic uint8_t *table, int64_t i, uint8_t k, uint8_t val)
686 | (val << H48_SHIFT(i, k)); 684 | (val << H48_SHIFT(i, k));
687} 685}
688 686
689STATIC_INLINE uint8_t
690get_h48_bound(
691 cube_t cube,
692 uint32_t cdata,
693 uint8_t h,
694 uint8_t k,
695 const uint8_t *table
696) {
697 int64_t coord;
698
699 coord = coord_h48_edges(cube, COCLASS(cdata), TTREP(cdata), h);
700 return get_h48_pval(table, coord, k);
701}
702
703size_t 687size_t
704gendata_h48_derive(uint8_t h, const void *fulltable, void *buf) 688gendata_h48_derive(uint8_t h, const void *fulltable, void *buf)
705{ 689{
diff --git a/src/solvers/h48/solve.h b/src/solvers/h48/solve.h
index 0723fb6..778155c 100644
--- a/src/solvers/h48/solve.h
+++ b/src/solvers/h48/solve.h
@@ -101,6 +101,7 @@ solve_h48_stop(dfsarg_solveh48_t *arg)
101{ 101{
102 uint32_t data, data_inv; 102 uint32_t data, data_inv;
103 int8_t cbound, cbound_inv, h48bound, h48bound_inv; 103 int8_t cbound, cbound_inv, h48bound, h48bound_inv;
104 int64_t coord, coord_inv;
104 105
105 arg->nissbranch = MM_NORMAL; 106 arg->nissbranch = MM_NORMAL;
106 cbound = get_h48_cdata(arg->cube, arg->cocsepdata, &data); 107 cbound = get_h48_cdata(arg->cube, arg->cocsepdata, &data);
@@ -111,15 +112,16 @@ solve_h48_stop(dfsarg_solveh48_t *arg)
111 if (cbound_inv + arg->nmoves + arg->npremoves > arg->depth) 112 if (cbound_inv + arg->nmoves + arg->npremoves > arg->depth)
112 return true; 113 return true;
113 114
114 h48bound = get_h48_bound(arg->cube, data, arg->h, arg->k, arg->h48data); 115 coord = coord_h48_edges(arg->cube, COCLASS(data), TTREP(data), arg->h);
116 h48bound = get_h48_pval(arg->h48data, coord, arg->k);
115 117
116 /* If the h48 bound is > 0, we add the base value. */ 118 /* If the h48 bound is > 0, we add the base value. */
117 /* Otherwise, we use the fallback h0k4 value instead. */ 119 /* Otherwise, we use the fallback h0k4 value instead. */
118 120
119 if (arg->k == 2) { 121 if (arg->k == 2) {
120 if (h48bound == 0) { 122 if (h48bound == 0) {
121 h48bound = get_h48_bound( 123 h48bound = get_h48_pval(
122 arg->cube, data, 0, 4, arg->h48data_fallback); 124 arg->h48data_fallback, coord >> arg->h, 4);
123 } else { 125 } else {
124 h48bound += arg->base; 126 h48bound += arg->base;
125 } 127 }
@@ -129,11 +131,13 @@ solve_h48_stop(dfsarg_solveh48_t *arg)
129 if (h48bound + arg->nmoves + arg->npremoves == arg->depth) 131 if (h48bound + arg->nmoves + arg->npremoves == arg->depth)
130 arg->nissbranch = MM_INVERSEBRANCH; 132 arg->nissbranch = MM_INVERSEBRANCH;
131 133
132 h48bound_inv = get_h48_bound(arg->inverse, data_inv, arg->h, arg->k, arg->h48data); 134 coord_inv = coord_h48_edges(
135 arg->inverse, COCLASS(data_inv), TTREP(data_inv), arg->h);
136 h48bound_inv = get_h48_pval(arg->h48data, coord_inv, arg->k);
133 if (arg->k == 2) { 137 if (arg->k == 2) {
134 if (h48bound_inv == 0) { 138 if (h48bound_inv == 0) {
135 h48bound_inv = get_h48_bound( 139 h48bound_inv = get_h48_pval(
136 arg->inverse, data_inv, 0, 4, arg->h48data_fallback); 140 arg->h48data_fallback, coord_inv >> arg->h, 4);
137 } else { 141 } else {
138 h48bound_inv += arg->base; 142 h48bound_inv += arg->base;
139 } 143 }
diff --git a/src/solvers/h48/stats.h b/src/solvers/h48/stats.h
index cc51bd9..2a7e887 100644
--- a/src/solvers/h48/stats.h
+++ b/src/solvers/h48/stats.h
@@ -36,7 +36,7 @@ solve_h48stats_dfs(dfsarg_solveh48stats_t *arg)
36 36
37 /* Check h48 lower bound for h=0 (esep, but no eo) */ 37 /* Check h48 lower bound for h=0 (esep, but no eo) */
38 coord = coord_h48_edges(arg->cube, COCLASS(d), TTREP(d), 0); 38 coord = coord_h48_edges(arg->cube, COCLASS(d), TTREP(d), 0);
39 bound = get_h48_bound(arg->cube, d, 0, 4, arg->h48data); 39 bound = get_h48_pval(arg->h48data, coord, 4);
40 if (bound + arg->nmoves > arg->depth) 40 if (bound + arg->nmoves > arg->depth)
41 return 0; 41 return 0;
42 42

Generated with cgit - Back to sebastiano.tronto.net