aboutsummaryrefslogtreecommitdiff
path: root/src/solvers/coord/gendata.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-05-18 08:48:13 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-05-18 08:48:13 +0200
commit8b94d135429a9f3253cc7f25a1453b412065c4a0 (patch)
tree4a31d6def5421e95fb98505a2bc2653c18fca330 /src/solvers/coord/gendata.h
parent30b43f08955158d4f2066f4b50fe8d1241b3177b (diff)
downloadnissy-core-8b94d135429a9f3253cc7f25a1453b412065c4a0.tar.gz
nissy-core-8b94d135429a9f3253cc7f25a1453b412065c4a0.zip
Refactor solver dispatch and checkdata
Diffstat (limited to 'src/solvers/coord/gendata.h')
-rw-r--r--src/solvers/coord/gendata.h35
1 files changed, 8 insertions, 27 deletions
diff --git a/src/solvers/coord/gendata.h b/src/solvers/coord/gendata.h
index 7a974f8..1b65f49 100644
--- a/src/solvers/coord/gendata.h
+++ b/src/solvers/coord/gendata.h
@@ -1,5 +1,6 @@
1STATIC size_t gendata_coord(const coord_t [static 1], unsigned char *); 1STATIC size_t gendata_coord(const coord_t [static 1], unsigned char *);
2STATIC int64_t gendata_coord_dispatch(const char *, unsigned char *); 2STATIC long long gendata_coord_dispatch(const char *, unsigned long long,
3 unsigned char *);
3STATIC tableinfo_t genptable_coord( 4STATIC tableinfo_t genptable_coord(
4 const coord_t [static 1], const unsigned char *, unsigned char *); 5 const coord_t [static 1], const unsigned char *, unsigned char *);
5STATIC bool switch_to_fromnew(uint64_t, uint64_t, uint64_t); 6STATIC bool switch_to_fromnew(uint64_t, uint64_t, uint64_t);
@@ -7,15 +8,17 @@ STATIC uint64_t genptable_coord_fillneighbors(const coord_t [static 1],
7 const unsigned char *, uint64_t, uint8_t, unsigned char *); 8 const unsigned char *, uint64_t, uint8_t, unsigned char *);
8STATIC uint64_t genptable_coord_fillfromnew(const coord_t [static 1], 9STATIC uint64_t genptable_coord_fillfromnew(const coord_t [static 1],
9 const unsigned char *, uint64_t, uint8_t, unsigned char *); 10 const unsigned char *, uint64_t, uint8_t, unsigned char *);
10STATIC void getdistribution_coord(const unsigned char *, const char *,
11 uint64_t [static INFO_DISTRIBUTION_LEN]);
12STATIC uint8_t get_coord_pval( 11STATIC uint8_t get_coord_pval(
13 const coord_t [static 1], const unsigned char *, uint64_t); 12 const coord_t [static 1], const unsigned char *, uint64_t);
14STATIC void set_coord_pval( 13STATIC void set_coord_pval(
15 const coord_t [static 1], unsigned char *, uint64_t, uint8_t); 14 const coord_t [static 1], unsigned char *, uint64_t, uint8_t);
16 15
17STATIC int64_t 16STATIC long long
18gendata_coord_dispatch(const char *coordstr, unsigned char *buf) 17gendata_coord_dispatch(
18 const char *coordstr,
19 unsigned long long bufsize,
20 unsigned char *buf
21)
19{ 22{
20 coord_t *coord; 23 coord_t *coord;
21 24
@@ -249,28 +252,6 @@ genptable_coord_fillfromnew(
249 return tot; 252 return tot;
250} 253}
251 254
252STATIC void
253getdistribution_coord(
254 const unsigned char *table,
255 const char *coord,
256 uint64_t distr[static INFO_DISTRIBUTION_LEN]
257)
258{
259 uint8_t v;
260 uint64_t i;
261 coord_t *c;
262
263 memset(distr, 0, INFO_DISTRIBUTION_LEN * sizeof(uint64_t));
264
265 if((c = parse_coord(strlen(coord), coord)) == NULL)
266 return;
267
268 for (i = 0; i < c->max; i++) {
269 v = get_coord_pval(c, table, i);
270 distr[v]++;
271 }
272}
273
274STATIC uint8_t 255STATIC uint8_t
275get_coord_pval( 256get_coord_pval(
276 const coord_t coord[static 1], 257 const coord_t coord[static 1],

Generated with cgit - Back to sebastiano.tronto.net