aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/solvers/h48/gendata_h48.h33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/solvers/h48/gendata_h48.h b/src/solvers/h48/gendata_h48.h
index 51f49b8..299491e 100644
--- a/src/solvers/h48/gendata_h48.h
+++ b/src/solvers/h48/gendata_h48.h
@@ -15,18 +15,18 @@ TODO: This loop over similar h48 coordinates can be improved by only
15transforming edges, but we need to compose transformations (i.e. conjugate 15transforming edges, but we need to compose transformations (i.e. conjugate
16_t by _ttrep). 16_t by _ttrep).
17*/ 17*/
18#define _foreach_h48sim(_cube, _cocsepdata, _selfsim, _h, _action) \ 18#define FOREACH_H48SIM(ARG_CUBE, ARG_COCSEPDATA, ARG_SELFSIM, ARG_ACTION) \
19 int64_t _cocsep = coord_cocsep(_cube); \ 19 int64_t VAR_COCSEP = coord_cocsep(ARG_CUBE); \
20 uint8_t _ttrep = TTREP(_cocsepdata[_cocsep]); \ 20 uint8_t VAR_TTREP = TTREP(ARG_COCSEPDATA[VAR_COCSEP]); \
21 uint8_t _inverse_ttrep = inverse_trans(_ttrep); \ 21 uint8_t VAR_INVERSE_TTREP = inverse_trans(VAR_TTREP); \
22 int64_t _coclass = COCLASS(_cocsepdata[_cocsep]); \ 22 int64_t VAR_COCLASS = COCLASS(ARG_COCSEPDATA[VAR_COCSEP]); \
23 cube_t _rep = transform(_cube, _ttrep); \ 23 cube_t VAR_REP = transform(ARG_CUBE, VAR_TTREP); \
24 uint64_t _sim = _selfsim[_coclass]; \ 24 uint64_t VAR_S = ARG_SELFSIM[VAR_COCLASS]; \
25 for (uint8_t _t = 0; _t < 48 && _sim; _t++, _sim >>= 1) { \ 25 for (uint8_t VAR_T = 0; VAR_T < 48 && VAR_S; VAR_T++, VAR_S >>= 1) { \
26 if (!(_sim & 1)) continue; \ 26 if (!(VAR_S & 1)) continue; \
27 _cube = transform(_rep, _t); \ 27 ARG_CUBE = transform(VAR_REP, VAR_T); \
28 _cube = transform(_cube, _inverse_ttrep); \ 28 ARG_CUBE = transform(ARG_CUBE, VAR_INVERSE_TTREP); \
29 _action \ 29 ARG_ACTION \
30 } 30 }
31 31
32typedef struct { 32typedef struct {
@@ -115,8 +115,7 @@ gen_h48short(gendata_h48short_arg_t *arg)
115 cube = invcoord_h48(kv.key, arg->crep, 11); 115 cube = invcoord_h48(kv.key, arg->crep, 11);
116 for (m = 0; m < 18; m++) { 116 for (m = 0; m < 18; m++) {
117 d = move(cube, m); 117 d = move(cube, m);
118 _foreach_h48sim( 118 FOREACH_H48SIM(d, arg->cocsepdata, arg->selfsim,
119 d, arg->cocsepdata, arg->selfsim, 11,
120 coord = coord_h48(d, arg->cocsepdata, 11); 119 coord = coord_h48(d, arg->cocsepdata, 11);
121 h48map_insertmin(arg->map, coord, i+1); 120 h48map_insertmin(arg->map, coord, i+1);
122 ) 121 )
@@ -237,7 +236,7 @@ gendata_h48h0k4_bfs_fromdone(h48h0k4_bfs_arg_t *arg)
237 j = coord_h48(moved, arg->cocsepdata, 0); 236 j = coord_h48(moved, arg->cocsepdata, 0);
238 if (get_esep_pval(arg->buf32, j, 4) <= arg->depth) 237 if (get_esep_pval(arg->buf32, j, 4) <= arg->depth)
239 continue; 238 continue;
240 _foreach_h48sim(moved, arg->cocsepdata, arg->selfsim, 0, 239 FOREACH_H48SIM(moved, arg->cocsepdata, arg->selfsim,
241 k = coord_h48(moved, arg->cocsepdata, 0); 240 k = coord_h48(moved, arg->cocsepdata, 0);
242 x = get_esep_pval(arg->buf32, k, 4); 241 x = get_esep_pval(arg->buf32, k, 4);
243 set_esep_pval(arg->buf32, k, 4, arg->depth); 242 set_esep_pval(arg->buf32, k, 4, arg->depth);
@@ -268,7 +267,7 @@ gendata_h48h0k4_bfs_fromnew(h48h0k4_bfs_arg_t *arg)
268 x = get_esep_pval(arg->buf32, j, 4); 267 x = get_esep_pval(arg->buf32, j, 4);
269 if (x >= arg->depth) 268 if (x >= arg->depth)
270 continue; 269 continue;
271 _foreach_h48sim(cube, arg->cocsepdata, arg->selfsim, 0, 270 FOREACH_H48SIM(cube, arg->cocsepdata, arg->selfsim,
272 j = coord_h48(cube, arg->cocsepdata, 0); 271 j = coord_h48(cube, arg->cocsepdata, 0);
273 x = get_esep_pval(arg->buf32, j, 4); 272 x = get_esep_pval(arg->buf32, j, 4);
274 set_esep_pval(arg->buf32, j, 4, arg->depth); 273 set_esep_pval(arg->buf32, j, 4, arg->depth);
@@ -375,7 +374,7 @@ gendata_h48k2_dfs(h48k2_dfs_arg_t *arg)
375 uint8_t m; 374 uint8_t m;
376 375
377 ccc = arg->cube; 376 ccc = arg->cube;
378 _foreach_h48sim(ccc, arg->cocsepdata, arg->selfsim, 11, 377 FOREACH_H48SIM(ccc, arg->cocsepdata, arg->selfsim,
379 fullcoord = coord_h48(ccc, arg->cocsepdata, 11); 378 fullcoord = coord_h48(ccc, arg->cocsepdata, 11);
380 coord = fullcoord >> (int64_t)(11 - arg->h); 379 coord = fullcoord >> (int64_t)(11 - arg->h);
381 oldval = get_esep_pval(arg->h48data, coord, arg->k); 380 oldval = get_esep_pval(arg->h48data, coord, arg->k);

Generated with cgit - Back to sebastiano.tronto.net