aboutsummaryrefslogtreecommitdiff
path: root/src/solvers
diff options
context:
space:
mode:
Diffstat (limited to 'src/solvers')
-rw-r--r--src/solvers/coord/dr.h2
-rw-r--r--src/solvers/coord/dreo.h2
-rw-r--r--src/solvers/coord/eo.h2
-rw-r--r--src/solvers/coord/types_macros.h2
-rw-r--r--src/solvers/h48/solve.h31
5 files changed, 19 insertions, 20 deletions
diff --git a/src/solvers/coord/dr.h b/src/solvers/coord/dr.h
index e197f8c..607cc39 100644
--- a/src/solvers/coord/dr.h
+++ b/src/solvers/coord/dr.h
@@ -24,7 +24,7 @@ STATIC coord_t coordinate_dr = {
24 .gendata = coordinate_dr_gendata, 24 .gendata = coordinate_dr_gendata,
25 .max = DREOESEP_CLASSES * POW_3_7, 25 .max = DREOESEP_CLASSES * POW_3_7,
26 .trans_mask = TM_UDFIX, 26 .trans_mask = TM_UDFIX,
27 .moves_mask = MM_ALLMOVES, 27 .moves_mask = MM18_ALLMOVES,
28 .axistrans = { 28 .axistrans = {
29 [AXIS_UD] = TRANS_UFr, 29 [AXIS_UD] = TRANS_UFr,
30 [AXIS_RL] = TRANS_RFr, 30 [AXIS_RL] = TRANS_RFr,
diff --git a/src/solvers/coord/dreo.h b/src/solvers/coord/dreo.h
index 2bc8cd1..1cce4e2 100644
--- a/src/solvers/coord/dreo.h
+++ b/src/solvers/coord/dreo.h
@@ -19,7 +19,7 @@ STATIC coord_t coordinate_dreo = {
19 .gendata = coordinate_dreo_gendata, 19 .gendata = coordinate_dreo_gendata,
20 .max = DRESEP_CLASSES * POW_3_7, 20 .max = DRESEP_CLASSES * POW_3_7,
21 .trans_mask = TM_UDRLFIX, 21 .trans_mask = TM_UDRLFIX,
22 .moves_mask = MM_EO, 22 .moves_mask = MM18_EO,
23 .axistrans = { 23 .axistrans = {
24 [AXIS_UD] = TRANS_UFr, 24 [AXIS_UD] = TRANS_UFr,
25 [AXIS_RL] = TRANS_RFr, 25 [AXIS_RL] = TRANS_RFr,
diff --git a/src/solvers/coord/eo.h b/src/solvers/coord/eo.h
index c8faaea..51dfb29 100644
--- a/src/solvers/coord/eo.h
+++ b/src/solvers/coord/eo.h
@@ -12,7 +12,7 @@ STATIC coord_t coordinate_eo = {
12 .gendata = coordinate_eo_gendata, 12 .gendata = coordinate_eo_gendata,
13 .max = POW_2_11, 13 .max = POW_2_11,
14 .trans_mask = TM_SINGLE(TRANS_UFr), 14 .trans_mask = TM_SINGLE(TRANS_UFr),
15 .moves_mask = MM_ALLMOVES, 15 .moves_mask = MM18_ALLMOVES,
16 .axistrans = { 16 .axistrans = {
17 [AXIS_UD] = TRANS_FDr, 17 [AXIS_UD] = TRANS_FDr,
18 [AXIS_RL] = TRANS_URr, 18 [AXIS_RL] = TRANS_URr,
diff --git a/src/solvers/coord/types_macros.h b/src/solvers/coord/types_macros.h
index 2767dcc..a5ac7f3 100644
--- a/src/solvers/coord/types_macros.h
+++ b/src/solvers/coord/types_macros.h
@@ -21,7 +21,7 @@ typedef struct {
21 bool (*isnasty)(uint64_t, const unsigned char *); 21 bool (*isnasty)(uint64_t, const unsigned char *);
22 size_t (*gendata)(unsigned char *); 22 size_t (*gendata)(unsigned char *);
23 uint64_t max; 23 uint64_t max;
24 uint32_t moves_mask; 24 uint64_t moves_mask;
25 uint64_t trans_mask; 25 uint64_t trans_mask;
26 uint8_t axistrans[3]; 26 uint8_t axistrans[3];
27 bool (*is_admissible)(const solution_moves_t[static 1]); 27 bool (*is_admissible)(const solution_moves_t[static 1]);
diff --git a/src/solvers/h48/solve.h b/src/solvers/h48/solve.h
index 86c590a..e3ef9b9 100644
--- a/src/solvers/h48/solve.h
+++ b/src/solvers/h48/solve.h
@@ -25,8 +25,8 @@ typedef struct {
25 const unsigned char *h48data; 25 const unsigned char *h48data;
26 const unsigned char *h48data_fallback_h0k4; 26 const unsigned char *h48data_fallback_h0k4;
27 const unsigned char *h48data_fallback_eoesep; 27 const unsigned char *h48data_fallback_eoesep;
28 uint32_t movemask_normal; 28 uint64_t movemask_normal;
29 uint32_t movemask_inverse; 29 uint64_t movemask_inverse;
30 int64_t nodes_visited; 30 int64_t nodes_visited;
31 int64_t table_fallbacks; 31 int64_t table_fallbacks;
32 int64_t table_lookups; 32 int64_t table_lookups;
@@ -72,7 +72,7 @@ solve_h48_stop(dfsarg_solve_h48_t arg[static 1])
72 arg->solution_settings->optimal) 72 arg->solution_settings->optimal)
73 return true; 73 return true;
74 74
75 arg->movemask_normal = arg->movemask_inverse = MM_ALLMOVES; 75 arg->movemask_normal = arg->movemask_inverse = MM18_ALLMOVES;
76 arg->nodes_visited++; 76 arg->nodes_visited++;
77 77
78 /* Preliminary probing using last computed bound, if possible */ 78 /* Preliminary probing using last computed bound, if possible */
@@ -113,7 +113,7 @@ solve_h48_stop(dfsarg_solve_h48_t arg[static 1])
113 if (arg->lb_inverse > target) 113 if (arg->lb_inverse > target)
114 return true; 114 return true;
115 nh = arg->lb_inverse == target; 115 nh = arg->lb_inverse == target;
116 arg->movemask_normal = nh * MM_NOHALFTURNS + (1-nh) * MM_ALLMOVES; 116 arg->movemask_normal = nh * MM18_NOHALFTURNS + (1-nh) * MM18_ALLMOVES;
117 117
118 /* Normal probing */ 118 /* Normal probing */
119 119
@@ -141,7 +141,7 @@ solve_h48_stop(dfsarg_solve_h48_t arg[static 1])
141 if (arg->lb_normal > target) 141 if (arg->lb_normal > target)
142 return true; 142 return true;
143 nh = arg->lb_normal == target; 143 nh = arg->lb_normal == target;
144 arg->movemask_inverse = nh * MM_NOHALFTURNS + (1-nh) * MM_ALLMOVES; 144 arg->movemask_inverse = nh * MM18_NOHALFTURNS + (1-nh) * MM18_ALLMOVES;
145 145
146 return false; 146 return false;
147} 147}
@@ -151,7 +151,7 @@ solve_h48_dfs(dfsarg_solve_h48_t arg[static 1])
151{ 151{
152 int64_t ret, n; 152 int64_t ret, n;
153 uint8_t m, nm, lbn, lbi; 153 uint8_t m, nm, lbn, lbi;
154 uint32_t mm_normal, mm_inverse; 154 uint64_t mm_normal, mm_inverse;
155 bool ulbi, ulbn; 155 bool ulbi, ulbn;
156 cube_t backup_cube, backup_inverse; 156 cube_t backup_cube, backup_inverse;
157 157
@@ -191,7 +191,7 @@ solve_h48_dfs(dfsarg_solve_h48_t arg[static 1])
191 if (popcount_u32(mm_normal) <= popcount_u32(mm_inverse)) { 191 if (popcount_u32(mm_normal) <= popcount_u32(mm_inverse)) {
192 arg->solution_moves->nmoves++; 192 arg->solution_moves->nmoves++;
193 for (m = 0; m < 18; m++) { 193 for (m = 0; m < 18; m++) {
194 if (!(mm_normal & (UINT32_C(1) << (uint32_t)m))) 194 if (!(mm_normal & MM_SINGLE(m)))
195 continue; 195 continue;
196 arg->solution_moves->moves[ 196 arg->solution_moves->moves[
197 arg->solution_moves->nmoves-1] = m; 197 arg->solution_moves->nmoves-1] = m;
@@ -209,7 +209,7 @@ solve_h48_dfs(dfsarg_solve_h48_t arg[static 1])
209 } else { 209 } else {
210 arg->solution_moves->npremoves++; 210 arg->solution_moves->npremoves++;
211 for (m = 0; m < 18; m++) { 211 for (m = 0; m < 18; m++) {
212 if(!(mm_inverse & (UINT32_C(1) << (uint32_t)m))) 212 if(!(mm_inverse & MM_SINGLE(m)))
213 continue; 213 continue;
214 arg->solution_moves->premoves[ 214 arg->solution_moves->premoves[
215 arg->solution_moves->npremoves-1] = m; 215 arg->solution_moves->npremoves-1] = m;
@@ -258,8 +258,8 @@ solve_h48_runthread(void *arg)
258 dfsarg->lb_inverse = 0; 258 dfsarg->lb_inverse = 0;
259 dfsarg->use_lb_normal = false; 259 dfsarg->use_lb_normal = false;
260 dfsarg->use_lb_inverse = false; 260 dfsarg->use_lb_inverse = false;
261 dfsarg->movemask_normal = MM_ALLMOVES; 261 dfsarg->movemask_normal = MM18_ALLMOVES;
262 dfsarg->movemask_inverse = MM_ALLMOVES; 262 dfsarg->movemask_inverse = MM18_ALLMOVES;
263 263
264 solve_h48_dfs(dfsarg); 264 solve_h48_dfs(dfsarg);
265 } 265 }
@@ -278,7 +278,7 @@ solve_h48_maketasks(
278 int r; 278 int r;
279 int64_t appret; 279 int64_t appret;
280 uint8_t m, t; 280 uint8_t m, t;
281 uint32_t mm; 281 uint64_t mm;
282 cube_t backup_cube; 282 cube_t backup_cube;
283 solution_moves_t moves; 283 solution_moves_t moves;
284 284
@@ -308,7 +308,7 @@ solve_h48_maketasks(
308 } 308 }
309 309
310 if (maketasks_arg->nmoves == 0) { 310 if (maketasks_arg->nmoves == 0) {
311 mm = MM_ALLMOVES; 311 mm = MM18_ALLMOVES;
312 } else { 312 } else {
313 m = maketasks_arg->moves[maketasks_arg->nmoves-1]; 313 m = maketasks_arg->moves[maketasks_arg->nmoves-1];
314 mm = allowedmask[movebase(m)]; 314 mm = allowedmask[movebase(m)];
@@ -317,7 +317,7 @@ solve_h48_maketasks(
317 maketasks_arg->nmoves++; 317 maketasks_arg->nmoves++;
318 backup_cube = maketasks_arg->cube; 318 backup_cube = maketasks_arg->cube;
319 for (m = 0; m < 18; m++) { 319 for (m = 0; m < 18; m++) {
320 if (!(mm & (1 << m))) 320 if (!(mm & MM_SINGLE(m)))
321 continue; 321 continue;
322 maketasks_arg->moves[maketasks_arg->nmoves-1] = m; 322 maketasks_arg->moves[maketasks_arg->nmoves-1] = m;
323 maketasks_arg->cube = move(backup_cube, m); 323 maketasks_arg->cube = move(backup_cube, m);
@@ -330,9 +330,8 @@ solve_h48_maketasks(
330 if (maketasks_arg->nmoves == 1) 330 if (maketasks_arg->nmoves == 1)
331 for (t = 0; t < NTRANS; t++) 331 for (t = 0; t < NTRANS; t++)
332 if (solve_arg->solution_settings->tmask & 332 if (solve_arg->solution_settings->tmask &
333 (UINT64_C(1) << (uint64_t)t)) 333 TM_SINGLE(t))
334 mm &= ~(UINT32_C(1) << 334 mm &= ~MM_SINGLE(transform_move(m, t));
335 (uint32_t)transform_move(m, t));
336 } 335 }
337 maketasks_arg->nmoves--; 336 maketasks_arg->nmoves--;
338 maketasks_arg->cube = backup_cube; 337 maketasks_arg->cube = backup_cube;

Generated with cgit - Back to sebastiano.tronto.net