aboutsummaryrefslogtreecommitdiff
path: root/src/solvers/h48
diff options
context:
space:
mode:
Diffstat (limited to 'src/solvers/h48')
-rw-r--r--src/solvers/h48/coordinate.h21
-rw-r--r--src/solvers/h48/coordinate_types_macros.h (renamed from src/solvers/h48/coordinate_macros.h)0
-rw-r--r--src/solvers/h48/gendata_cocsep.h39
-rw-r--r--src/solvers/h48/gendata_eoesep.h17
-rw-r--r--src/solvers/h48/gendata_h48.h61
-rw-r--r--src/solvers/h48/gendata_types_macros.h2
-rw-r--r--src/solvers/h48/h48.h4
-rw-r--r--src/solvers/h48/map.h31
-rw-r--r--src/solvers/h48/solve.h18
9 files changed, 102 insertions, 91 deletions
diff --git a/src/solvers/h48/coordinate.h b/src/solvers/h48/coordinate.h
index 6caac2a..eb08fd8 100644
--- a/src/solvers/h48/coordinate.h
+++ b/src/solvers/h48/coordinate.h
@@ -1,12 +1,15 @@
1/* Macros defined in a separate file for easier testing */ 1STATIC_INLINE int64_t coord_h48(
2#include "coordinate_macros.h" 2 cube_t, const uint32_t [static COCSEP_TABLESIZE], uint8_t);
3
4STATIC_INLINE int64_t coord_h48(cube_t, const uint32_t *, uint8_t);
5STATIC_INLINE int64_t coord_h48_edges(cube_t, int64_t, uint8_t, uint8_t); 3STATIC_INLINE int64_t coord_h48_edges(cube_t, int64_t, uint8_t, uint8_t);
6STATIC_INLINE cube_t invcoord_h48(int64_t, const cube_t *, uint8_t); 4STATIC_INLINE cube_t invcoord_h48(
5 int64_t, const cube_t [static COCSEP_CLASSES], uint8_t);
7 6
8STATIC_INLINE int64_t 7STATIC_INLINE int64_t
9coord_h48(cube_t c, const uint32_t *cocsepdata, uint8_t h) 8coord_h48(
9 cube_t c,
10 const uint32_t cocsepdata[static COCSEP_TABLESIZE],
11 uint8_t h
12)
10{ 13{
11 int64_t cocsep, coclass; 14 int64_t cocsep, coclass;
12 uint32_t data; 15 uint32_t data;
@@ -42,7 +45,11 @@ the given value, because it works up to symmetry. This means that the
42returned cube is a transformed cube of one that gives the correct value. 45returned cube is a transformed cube of one that gives the correct value.
43*/ 46*/
44STATIC_INLINE cube_t 47STATIC_INLINE cube_t
45invcoord_h48(int64_t i, const cube_t *crep, uint8_t h) 48invcoord_h48(
49 int64_t i,
50 const cube_t crep[static COCSEP_CLASSES],
51 uint8_t h
52)
46{ 53{
47 cube_t ret; 54 cube_t ret;
48 int64_t hh, coclass, ee, esep, eo; 55 int64_t hh, coclass, ee, esep, eo;
diff --git a/src/solvers/h48/coordinate_macros.h b/src/solvers/h48/coordinate_types_macros.h
index 04462d6..04462d6 100644
--- a/src/solvers/h48/coordinate_macros.h
+++ b/src/solvers/h48/coordinate_types_macros.h
diff --git a/src/solvers/h48/gendata_cocsep.h b/src/solvers/h48/gendata_cocsep.h
index bf67962..cda1608 100644
--- a/src/solvers/h48/gendata_cocsep.h
+++ b/src/solvers/h48/gendata_cocsep.h
@@ -1,11 +1,15 @@
1STATIC_INLINE bool gendata_cocsep_get_visited(const uint8_t *, int64_t);
2STATIC_INLINE void gendata_cocsep_set_visited(uint8_t *, int64_t);
3
4STATIC size_t gendata_cocsep(char *, uint64_t *, cube_t *); 1STATIC size_t gendata_cocsep(char *, uint64_t *, cube_t *);
5STATIC uint32_t gendata_cocsep_dfs(cocsep_dfs_arg_t *); 2STATIC uint32_t gendata_cocsep_dfs(cocsep_dfs_arg_t [static 1]);
6STATIC void getdistribution_cocsep(const uint32_t *, uint64_t [static 21]); 3STATIC void getdistribution_cocsep(
4 const uint32_t [static COCSEP_TABLESIZE], uint64_t [static 21]);
5
6STATIC_INLINE bool gendata_cocsep_get_visited(
7 const uint8_t [static COCSEP_VISITEDSIZE], int64_t);
8STATIC_INLINE void gendata_cocsep_set_visited(
9 uint8_t [static COCSEP_VISITEDSIZE], int64_t);
7 10
8STATIC_INLINE int8_t get_h48_cdata(cube_t, const uint32_t *, uint32_t *); 11STATIC_INLINE int8_t get_h48_cdata(
12 cube_t, const uint32_t [static COCSEP_TABLESIZE], uint32_t *);
9 13
10STATIC size_t 14STATIC size_t
11gendata_cocsep( 15gendata_cocsep(
@@ -78,7 +82,7 @@ gendata_cocsep_return_size:
78} 82}
79 83
80STATIC uint32_t 84STATIC uint32_t
81gendata_cocsep_dfs(cocsep_dfs_arg_t *arg) 85gendata_cocsep_dfs(cocsep_dfs_arg_t arg[static 1])
82{ 86{
83 uint8_t m; 87 uint8_t m;
84 uint32_t cc, class, ttrep, depth, olddepth, tinv; 88 uint32_t cc, class, ttrep, depth, olddepth, tinv;
@@ -133,7 +137,10 @@ gendata_cocsep_dfs(cocsep_dfs_arg_t *arg)
133} 137}
134 138
135STATIC void 139STATIC void
136getdistribution_cocsep(const uint32_t *table, uint64_t distr[static 21]) 140getdistribution_cocsep(
141 const uint32_t table[static COCSEP_TABLESIZE],
142 uint64_t distr[static 21]
143)
137{ 144{
138 size_t i; 145 size_t i;
139 146
@@ -144,19 +151,29 @@ getdistribution_cocsep(const uint32_t *table, uint64_t distr[static 21])
144} 151}
145 152
146STATIC_INLINE bool 153STATIC_INLINE bool
147gendata_cocsep_get_visited(const uint8_t *a, int64_t i) 154gendata_cocsep_get_visited(
155 const uint8_t a[static COCSEP_VISITEDSIZE],
156 int64_t i
157)
148{ 158{
149 return a[VISITED_IND(i)] & VISITED_MASK(i); 159 return a[VISITED_IND(i)] & VISITED_MASK(i);
150} 160}
151 161
152STATIC_INLINE void 162STATIC_INLINE void
153gendata_cocsep_set_visited(uint8_t *a, int64_t i) 163gendata_cocsep_set_visited(
164 uint8_t a[static COCSEP_VISITEDSIZE],
165 int64_t i
166)
154{ 167{
155 a[VISITED_IND(i)] |= VISITED_MASK(i); 168 a[VISITED_IND(i)] |= VISITED_MASK(i);
156} 169}
157 170
158STATIC_INLINE int8_t 171STATIC_INLINE int8_t
159get_h48_cdata(cube_t cube, const uint32_t *cocsepdata, uint32_t *cdata) 172get_h48_cdata(
173 cube_t cube,
174 const uint32_t cocsepdata[static COCSEP_TABLESIZE],
175 uint32_t *cdata
176)
160{ 177{
161 int64_t coord; 178 int64_t coord;
162 179
diff --git a/src/solvers/h48/gendata_eoesep.h b/src/solvers/h48/gendata_eoesep.h
index d887209..4bf5a84 100644
--- a/src/solvers/h48/gendata_eoesep.h
+++ b/src/solvers/h48/gendata_eoesep.h
@@ -12,9 +12,11 @@ STATIC uint32_t gendata_eoesep_marksim(int64_t, uint8_t,
12 uint8_t [static EOESEP_BUF], uint32_t [static ESEP_MAX]); 12 uint8_t [static EOESEP_BUF], uint32_t [static ESEP_MAX]);
13STATIC bool gendata_eoesep_next(cube_t, uint8_t, 13STATIC bool gendata_eoesep_next(cube_t, uint8_t,
14 uint8_t [static EOESEP_BUF], uint32_t [static ESEP_MAX]); 14 uint8_t [static EOESEP_BUF], uint32_t [static ESEP_MAX]);
15STATIC uint8_t get_eoesep_pval(const uint8_t *, int64_t); 15STATIC uint8_t get_eoesep_pval(
16 const uint8_t [static DIV_ROUND_UP(EOESEP_TABLESIZE, 2)], int64_t);
16STATIC uint8_t get_eoesep_pval_cube(const void *, cube_t); 17STATIC uint8_t get_eoesep_pval_cube(const void *, cube_t);
17STATIC void set_eoesep_pval(uint8_t *, int64_t, uint8_t); 18STATIC void set_eoesep_pval(
19 uint8_t [static DIV_ROUND_UP(EOESEP_TABLESIZE, 2)], int64_t, uint8_t);
18 20
19STATIC int64_t 21STATIC int64_t
20coord_eoesep_sym(cube_t c, const uint32_t esep_classes[static ESEP_MAX]) 22coord_eoesep_sym(cube_t c, const uint32_t esep_classes[static ESEP_MAX])
@@ -247,7 +249,10 @@ gendata_eoesep_next(
247} 249}
248 250
249STATIC uint8_t 251STATIC uint8_t
250get_eoesep_pval(const uint8_t *table, int64_t i) 252get_eoesep_pval(
253 const uint8_t table[static DIV_ROUND_UP(EOESEP_TABLESIZE, 2)],
254 int64_t i
255)
251{ 256{
252 return (table[EOESEP_INDEX(i)] & EOESEP_MASK(i)) >> EOESEP_SHIFT(i); 257 return (table[EOESEP_INDEX(i)] & EOESEP_MASK(i)) >> EOESEP_SHIFT(i);
253} 258}
@@ -267,7 +272,11 @@ get_eoesep_pval_cube(const void *data, cube_t c)
267} 272}
268 273
269STATIC void 274STATIC void
270set_eoesep_pval(uint8_t *table, int64_t i, uint8_t val) 275set_eoesep_pval(
276 uint8_t table[static DIV_ROUND_UP(EOESEP_TABLESIZE, 2)],
277 int64_t i,
278 uint8_t val
279)
271{ 280{
272 table[EOESEP_INDEX(i)] = (table[EOESEP_INDEX(i)] & (~EOESEP_MASK(i))) 281 table[EOESEP_INDEX(i)] = (table[EOESEP_INDEX(i)] & (~EOESEP_MASK(i)))
273 | (val << EOESEP_SHIFT(i)); 282 | (val << EOESEP_SHIFT(i));
diff --git a/src/solvers/h48/gendata_h48.h b/src/solvers/h48/gendata_h48.h
index 2d9a9f7..959264d 100644
--- a/src/solvers/h48/gendata_h48.h
+++ b/src/solvers/h48/gendata_h48.h
@@ -1,17 +1,17 @@
1STATIC uint64_t gendata_h48short(gendata_h48short_arg_t *); 1STATIC uint64_t genddfggta_h48short(gendata_h48short_arg_t [static 1]);
2STATIC int64_t gendata_h48(gendata_h48_arg_t *); 2STATIC int64_t gendata_h48(gendata_h48_arg_t [static 1]);
3STATIC void gendata_h48h0k4(gendata_h48_arg_t *); 3STATIC void gendata_h48h0k4(gendata_h48_arg_t [static 1]);
4STATIC void gendata_h48k2(gendata_h48_arg_t *); 4STATIC void gendata_h48k2(gendata_h48_arg_t [static 1]);
5STATIC void gendata_h48k2_realcoord(gendata_h48_arg_t *);
6 5
7STATIC void * gendata_h48h0k4_runthread(void *); 6STATIC void * gendata_h48h0k4_runthread(void *);
8STATIC void * gendata_h48k2_runthread(void *); 7STATIC void * gendata_h48k2_runthread(void *);
9 8
10STATIC_INLINE void gendata_h48_mark_atomic(gendata_h48_mark_t *); 9STATIC_INLINE void gendata_h48_mark_atomic(gendata_h48_mark_t [static 1]);
11STATIC_INLINE void gendata_h48_mark(gendata_h48_mark_t *); 10STATIC_INLINE void gendata_h48_mark(gendata_h48_mark_t [static 1]);
12STATIC_INLINE bool gendata_h48k2_dfs_stop(cube_t, int8_t, h48k2_dfs_arg_t *); 11STATIC_INLINE bool gendata_h48k2_dfs_stop(
13STATIC void gendata_h48k2_dfs(h48k2_dfs_arg_t *arg); 12 cube_t, int8_t, h48k2_dfs_arg_t [static 1]);
14STATIC tableinfo_t makeinfo_h48k2(gendata_h48_arg_t *); 13STATIC void gendata_h48k2_dfs(h48k2_dfs_arg_t [static 1]);
14STATIC tableinfo_t makeinfo_h48k2(gendata_h48_arg_t [static 1]);
15STATIC void getdistribution_h48(const uint8_t *, 15STATIC void getdistribution_h48(const uint8_t *,
16 uint64_t [static INFO_DISTRIBUTION_LEN], uint8_t, uint8_t); 16 uint64_t [static INFO_DISTRIBUTION_LEN], uint8_t, uint8_t);
17 17
@@ -28,7 +28,7 @@ STATIC_INLINE void set_h48_pval_atomic(
28size_t gendata_h48_derive(uint8_t, const void *, void *); 28size_t gendata_h48_derive(uint8_t, const void *, void *);
29 29
30STATIC uint64_t 30STATIC uint64_t
31gendata_h48short(gendata_h48short_arg_t *arg) 31gendata_h48short(gendata_h48short_arg_t arg[static 1])
32{ 32{
33 uint8_t i, m; 33 uint8_t i, m;
34 int64_t coord; 34 int64_t coord;
@@ -62,7 +62,7 @@ gendata_h48short(gendata_h48short_arg_t *arg)
62} 62}
63 63
64STATIC int64_t 64STATIC int64_t
65gendata_h48(gendata_h48_arg_t *arg) 65gendata_h48(gendata_h48_arg_t arg[static 1])
66{ 66{
67 uint64_t size, cocsepsize, h48size, fallbacksize, fallback2size, of; 67 uint64_t size, cocsepsize, h48size, fallbacksize, fallback2size, of;
68 long long r; 68 long long r;
@@ -70,11 +70,6 @@ gendata_h48(gendata_h48_arg_t *arg)
70 tableinfo_t cocsepinfo, h48info, fallbackinfo; 70 tableinfo_t cocsepinfo, h48info, fallbackinfo;
71 gendata_h48_arg_t arg_h0k4; 71 gendata_h48_arg_t arg_h0k4;
72 72
73 if (arg == NULL) {
74 LOG("Error computing H48 data: arg is NULL.\n");
75 return NISSY_ERROR_UNKNOWN;
76 }
77
78 cocsepsize = COCSEP_FULLSIZE; 73 cocsepsize = COCSEP_FULLSIZE;
79 h48size = INFOSIZE + H48_TABLESIZE(arg->h, arg->k); 74 h48size = INFOSIZE + H48_TABLESIZE(arg->h, arg->k);
80 fallbacksize = arg->k == 2 ? INFOSIZE + H48_TABLESIZE(0, 4) : 0; 75 fallbacksize = arg->k == 2 ? INFOSIZE + H48_TABLESIZE(0, 4) : 0;
@@ -107,8 +102,6 @@ gendata_h48(gendata_h48_arg_t *arg)
107 102
108 if (arg->h == 0 && arg->k == 4) { 103 if (arg->h == 0 && arg->k == 4) {
109 gendata_h48h0k4(arg); 104 gendata_h48h0k4(arg);
110 } else if ((arg->h == 0 || arg->h == 11) && arg->k == 2) {
111 gendata_h48k2_realcoord(arg);
112 } else if (arg->k == 2) { 105 } else if (arg->k == 2) {
113 gendata_h48k2(arg); 106 gendata_h48k2(arg);
114 } else { 107 } else {
@@ -189,7 +182,7 @@ gendata_h48(gendata_h48_arg_t *arg)
189} 182}
190 183
191STATIC void 184STATIC void
192gendata_h48h0k4(gendata_h48_arg_t *arg) 185gendata_h48h0k4(gendata_h48_arg_t arg[static 1])
193{ 186{
194 _Atomic uint8_t *table; 187 _Atomic uint8_t *table;
195 uint8_t val; 188 uint8_t val;
@@ -325,7 +318,7 @@ gendata_h48h0k4_runthread(void *arg)
325} 318}
326 319
327STATIC void 320STATIC void
328gendata_h48k2(gendata_h48_arg_t *arg) 321gendata_h48k2(gendata_h48_arg_t arg[static 1])
329{ 322{
330 static const uint8_t shortdepth = 8; 323 static const uint8_t shortdepth = 8;
331 static const uint64_t capacity = 10000019; 324 static const uint64_t capacity = 10000019;
@@ -483,7 +476,7 @@ gendata_h48k2_runthread(void *arg)
483} 476}
484 477
485STATIC void 478STATIC void
486gendata_h48k2_dfs(h48k2_dfs_arg_t *arg) 479gendata_h48k2_dfs(h48k2_dfs_arg_t arg[static 1])
487{ 480{
488 int8_t d; 481 int8_t d;
489 uint8_t m[4]; 482 uint8_t m[4];
@@ -562,7 +555,7 @@ gendata_h48k2_dfs(h48k2_dfs_arg_t *arg)
562} 555}
563 556
564STATIC_INLINE void 557STATIC_INLINE void
565gendata_h48_mark_atomic(gendata_h48_mark_t *arg) 558gendata_h48_mark_atomic(gendata_h48_mark_t arg[static 1])
566{ 559{
567 uint8_t oldval, newval; 560 uint8_t oldval, newval;
568 int64_t coord, mutex; 561 int64_t coord, mutex;
@@ -582,7 +575,7 @@ gendata_h48_mark_atomic(gendata_h48_mark_t *arg)
582} 575}
583 576
584STATIC_INLINE void 577STATIC_INLINE void
585gendata_h48_mark(gendata_h48_mark_t *arg) 578gendata_h48_mark(gendata_h48_mark_t arg[static 1])
586{ 579{
587 uint8_t oldval, newval; 580 uint8_t oldval, newval;
588 int64_t coord, mutex; 581 int64_t coord, mutex;
@@ -599,7 +592,7 @@ gendata_h48_mark(gendata_h48_mark_t *arg)
599} 592}
600 593
601STATIC_INLINE bool 594STATIC_INLINE bool
602gendata_h48k2_dfs_stop(cube_t cube, int8_t depth, h48k2_dfs_arg_t *arg) 595gendata_h48k2_dfs_stop(cube_t cube, int8_t d, h48k2_dfs_arg_t arg[static 1])
603{ 596{
604 uint64_t val; 597 uint64_t val;
605 int64_t coord, mutex; 598 int64_t coord, mutex;
@@ -613,7 +606,7 @@ gendata_h48k2_dfs_stop(cube_t cube, int8_t depth, h48k2_dfs_arg_t *arg)
613 pthread_mutex_lock(arg->table_mutex[mutex]); 606 pthread_mutex_lock(arg->table_mutex[mutex]);
614 oldval = get_h48_pval(arg->table, coord, arg->k); 607 oldval = get_h48_pval(arg->table, coord, arg->k);
615 pthread_mutex_unlock(arg->table_mutex[mutex]); 608 pthread_mutex_unlock(arg->table_mutex[mutex]);
616 return oldval <= depth; 609 return oldval <= d;
617 } else { 610 } else {
618 /* With 0 < k < 11 we do not have a "real coordinate". 611 /* With 0 < k < 11 we do not have a "real coordinate".
619 The best we can do is checking if we backtracked to 612 The best we can do is checking if we backtracked to
@@ -624,22 +617,8 @@ gendata_h48k2_dfs_stop(cube_t cube, int8_t depth, h48k2_dfs_arg_t *arg)
624 } 617 }
625} 618}
626 619
627STATIC void
628gendata_h48k2_realcoord(gendata_h48_arg_t *arg)
629{
630 /* TODO */
631 gendata_h48k2(arg);
632}
633
634STATIC void *
635gendata_h48k2_realcoord_runthread(void *arg)
636{
637 /* TODO */
638 return NULL;
639}
640
641STATIC tableinfo_t 620STATIC tableinfo_t
642makeinfo_h48k2(gendata_h48_arg_t *arg) 621makeinfo_h48k2(gendata_h48_arg_t arg[static 1])
643{ 622{
644 tableinfo_t info; 623 tableinfo_t info;
645 624
diff --git a/src/solvers/h48/gendata_types_macros.h b/src/solvers/h48/gendata_types_macros.h
index ec6576a..11940d8 100644
--- a/src/solvers/h48/gendata_types_macros.h
+++ b/src/solvers/h48/gendata_types_macros.h
@@ -33,7 +33,7 @@
33/* 33/*
34TODO: This loop over similar h48 coordinates can be improved by only 34TODO: This loop over similar h48 coordinates can be improved by only
35transforming edges, but we need to compose transformations (i.e. conjugate 35transforming edges, but we need to compose transformations (i.e. conjugate
36_t by _ttrep). 36VAR_T by VAR_TTREP).
37*/ 37*/
38#define FOREACH_H48SIM(ARG_CUBE, ARG_COCSEPDATA, ARG_SELFSIM, ARG_ACTION) \ 38#define FOREACH_H48SIM(ARG_CUBE, ARG_COCSEPDATA, ARG_SELFSIM, ARG_ACTION) \
39 int64_t VAR_COCSEP = coord_cocsep(ARG_CUBE); \ 39 int64_t VAR_COCSEP = coord_cocsep(ARG_CUBE); \
diff --git a/src/solvers/h48/h48.h b/src/solvers/h48/h48.h
index d5a67ef..0cfa773 100644
--- a/src/solvers/h48/h48.h
+++ b/src/solvers/h48/h48.h
@@ -1,6 +1,8 @@
1#include "coordinate_types_macros.h"
2#include "map_types_macros.h"
3#include "gendata_types_macros.h"
1#include "coordinate.h" 4#include "coordinate.h"
2#include "map.h" 5#include "map.h"
3#include "gendata_types_macros.h"
4#include "gendata_cocsep.h" 6#include "gendata_cocsep.h"
5#include "gendata_eoesep.h" 7#include "gendata_eoesep.h"
6#include "gendata_h48.h" 8#include "gendata_h48.h"
diff --git a/src/solvers/h48/map.h b/src/solvers/h48/map.h
index e6903ce..7718794 100644
--- a/src/solvers/h48/map.h
+++ b/src/solvers/h48/map.h
@@ -1,16 +1,13 @@
1/* Type definitions and macros are in a separate file for easier testing */ 1STATIC void h48map_create(h48map_t [static 1], uint64_t, uint64_t);
2#include "map_types_macros.h" 2STATIC void h48map_clear(h48map_t [static 1]);
3 3STATIC void h48map_destroy(h48map_t [static 1]);
4STATIC void h48map_create(h48map_t *, uint64_t, uint64_t); 4STATIC uint64_t h48map_lookup(h48map_t [static 1], uint64_t);
5STATIC void h48map_clear(h48map_t *); 5STATIC void h48map_insertmin(h48map_t [static 1], uint64_t, uint64_t);
6STATIC void h48map_destroy(h48map_t *); 6STATIC uint64_t h48map_value(h48map_t [static 1], uint64_t);
7STATIC uint64_t h48map_lookup(h48map_t *, uint64_t); 7STATIC kvpair_t h48map_nextkvpair(h48map_t [static 1], uint64_t [static 1]);
8STATIC void h48map_insertmin(h48map_t *, uint64_t, uint64_t);
9STATIC uint64_t h48map_value(h48map_t *, uint64_t);
10STATIC kvpair_t h48map_nextkvpair(h48map_t *, uint64_t *);
11 8
12STATIC void 9STATIC void
13h48map_create(h48map_t *map, uint64_t capacity, uint64_t randomizer) 10h48map_create(h48map_t map[static 1], uint64_t capacity, uint64_t randomizer)
14{ 11{
15 map->capacity = capacity; 12 map->capacity = capacity;
16 map->randomizer = randomizer; 13 map->randomizer = randomizer;
@@ -20,20 +17,20 @@ h48map_create(h48map_t *map, uint64_t capacity, uint64_t randomizer)
20} 17}
21 18
22STATIC void 19STATIC void
23h48map_clear(h48map_t *map) 20h48map_clear(h48map_t map[static 1])
24{ 21{
25 memset(map->table, 0xFF, map->capacity * sizeof(uint64_t)); 22 memset(map->table, 0xFF, map->capacity * sizeof(uint64_t));
26 map->n = 0; 23 map->n = 0;
27} 24}
28 25
29STATIC void 26STATIC void
30h48map_destroy(h48map_t *map) 27h48map_destroy(h48map_t map[static 1])
31{ 28{
32 free(map->table); 29 free(map->table);
33} 30}
34 31
35STATIC_INLINE uint64_t 32STATIC_INLINE uint64_t
36h48map_lookup(h48map_t *map, uint64_t x) 33h48map_lookup(h48map_t map[static 1], uint64_t x)
37{ 34{
38 uint64_t hash, i; 35 uint64_t hash, i;
39 36
@@ -47,7 +44,7 @@ h48map_lookup(h48map_t *map, uint64_t x)
47} 44}
48 45
49STATIC_INLINE void 46STATIC_INLINE void
50h48map_insertmin(h48map_t *map, uint64_t key, uint64_t val) 47h48map_insertmin(h48map_t map[static 1], uint64_t key, uint64_t val)
51{ 48{
52 uint64_t i, oldval, min; 49 uint64_t i, oldval, min;
53 50
@@ -60,13 +57,13 @@ h48map_insertmin(h48map_t *map, uint64_t key, uint64_t val)
60} 57}
61 58
62STATIC_INLINE uint64_t 59STATIC_INLINE uint64_t
63h48map_value(h48map_t *map, uint64_t key) 60h48map_value(h48map_t map[static 1], uint64_t key)
64{ 61{
65 return map->table[h48map_lookup(map, key)] >> MAP_KEYSHIFT; 62 return map->table[h48map_lookup(map, key)] >> MAP_KEYSHIFT;
66} 63}
67 64
68STATIC kvpair_t 65STATIC kvpair_t
69h48map_nextkvpair(h48map_t *map, uint64_t *p) 66h48map_nextkvpair(h48map_t map[static 1], uint64_t p[static 1])
70{ 67{
71 kvpair_t kv; 68 kvpair_t kv;
72 uint64_t pair; 69 uint64_t pair;
diff --git a/src/solvers/h48/solve.h b/src/solvers/h48/solve.h
index dbd15bb..dcec5a4 100644
--- a/src/solvers/h48/solve.h
+++ b/src/solvers/h48/solve.h
@@ -46,18 +46,18 @@ typedef struct {
46 int8_t *shortest_sol; 46 int8_t *shortest_sol;
47} dfsarg_solve_h48_maketasks_t; 47} dfsarg_solve_h48_maketasks_t;
48 48
49STATIC_INLINE bool solve_h48_stop(dfsarg_solve_h48_t *); 49STATIC_INLINE bool solve_h48_stop(dfsarg_solve_h48_t [static 1]);
50STATIC int64_t solve_h48_maketasks( 50STATIC int64_t solve_h48_maketasks(
51 dfsarg_solve_h48_t *, dfsarg_solve_h48_maketasks_t *, 51 dfsarg_solve_h48_t [static 1], dfsarg_solve_h48_maketasks_t [static 1],
52 solve_h48_task_t [static STARTING_CUBES], int *); 52 solve_h48_task_t [static STARTING_CUBES], int [static 1]);
53STATIC void *solve_h48_runthread(void *); 53STATIC void *solve_h48_runthread(void *);
54STATIC int64_t solve_h48_dfs(dfsarg_solve_h48_t *); 54STATIC int64_t solve_h48_dfs(dfsarg_solve_h48_t [static 1]);
55STATIC int64_t solve_h48(cube_t, int8_t, int8_t, uint64_t, int8_t, int8_t, 55STATIC int64_t solve_h48(cube_t, int8_t, int8_t, uint64_t, int8_t, int8_t,
56 uint64_t, const void *, size_t n, char [n], 56 uint64_t, const void *, size_t n, char [n],
57 long long [static NISSY_SIZE_SOLVE_STATS]); 57 long long [static NISSY_SIZE_SOLVE_STATS]);
58 58
59STATIC_INLINE bool 59STATIC_INLINE bool
60solve_h48_stop(dfsarg_solve_h48_t *arg) 60solve_h48_stop(dfsarg_solve_h48_t arg[static 1])
61{ 61{
62 uint32_t data, data_inv; 62 uint32_t data, data_inv;
63 int64_t coord; 63 int64_t coord;
@@ -145,7 +145,7 @@ solve_h48_stop(dfsarg_solve_h48_t *arg)
145} 145}
146 146
147STATIC int64_t 147STATIC int64_t
148solve_h48_dfs(dfsarg_solve_h48_t *arg) 148solve_h48_dfs(dfsarg_solve_h48_t arg[static 1])
149{ 149{
150 int64_t ret, n; 150 int64_t ret, n;
151 uint8_t m, nm, lbn, lbi; 151 uint8_t m, nm, lbn, lbi;
@@ -261,10 +261,10 @@ solve_h48_runthread(void *arg)
261 261
262STATIC int64_t 262STATIC int64_t
263solve_h48_maketasks( 263solve_h48_maketasks(
264 dfsarg_solve_h48_t *solve_arg, 264 dfsarg_solve_h48_t solve_arg[static 1],
265 dfsarg_solve_h48_maketasks_t *maketasks_arg, 265 dfsarg_solve_h48_maketasks_t maketasks_arg[static 1],
266 solve_h48_task_t tasks[static STARTING_CUBES], 266 solve_h48_task_t tasks[static STARTING_CUBES],
267 int *ntasks 267 int ntasks[static 1]
268) 268)
269{ 269{
270 int r; 270 int r;

Generated with cgit - Back to sebastiano.tronto.net