diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-10-16 11:46:33 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-10-16 11:46:38 +0200 |
| commit | f9570e5089eeabe32be84ab0507c1d9df99650af (patch) | |
| tree | a7e89e26b84d833fcc29fecc19d5e6f6c61af3e6 /src/solvers/h48/solve.h | |
| parent | 7c994d0ee99d8b69bf958f1559db3a294f459e3e (diff) | |
| download | nissy-core-f9570e5089eeabe32be84ab0507c1d9df99650af.tar.gz nissy-core-f9570e5089eeabe32be84ab0507c1d9df99650af.zip | |
Removed redundant coordinate computation
Diffstat (limited to 'src/solvers/h48/solve.h')
| -rw-r--r-- | src/solvers/h48/solve.h | 16 |
1 files changed, 10 insertions, 6 deletions
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 | } |
