diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-03-14 16:46:50 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-03-14 16:46:50 +0100 |
| commit | 9e6465bcc8f0d9bd1d78ad357a623452358ba7f2 (patch) | |
| tree | e5c43d89de835424445be9935e9c9dbd1933085d /src | |
| parent | 1e1fd628207034b0412c50e289f146d34c5baf71 (diff) | |
| download | nissy-core-9e6465bcc8f0d9bd1d78ad357a623452358ba7f2.tar.gz nissy-core-9e6465bcc8f0d9bd1d78ad357a623452358ba7f2.zip | |
Added checkdata for coord EO
Diffstat (limited to 'src')
| -rw-r--r-- | src/nissy.c | 5 | ||||
| -rw-r--r-- | src/solvers/coord/gendata.h | 24 | ||||
| -rw-r--r-- | src/solvers/h48/gendata_h48.h | 1 |
3 files changed, 30 insertions, 0 deletions
diff --git a/src/nissy.c b/src/nissy.c index 2766b12..431362d 100644 --- a/src/nissy.c +++ b/src/nissy.c | |||
| @@ -80,8 +80,13 @@ checkdata(const char *buf, const tableinfo_t *info) | |||
| 80 | } else if (!strncmp(info->solver, "h48", 3)) { | 80 | } else if (!strncmp(info->solver, "h48", 3)) { |
| 81 | getdistribution_h48((uint8_t *)buf + INFOSIZE, distr, | 81 | getdistribution_h48((uint8_t *)buf + INFOSIZE, distr, |
| 82 | info->h48h, info->bits); | 82 | info->h48h, info->bits); |
| 83 | } else if (!strncmp(info->solver, "coordinate solver for ", 22)) { | ||
| 84 | getdistribution_coord((uint8_t *)buf + INFOSIZE, | ||
| 85 | info->solver + 22, distr); | ||
| 83 | } else if (!strncmp(info->solver, "eoesep data for h48", 19)) { | 86 | } else if (!strncmp(info->solver, "eoesep data for h48", 19)) { |
| 84 | return true; | 87 | return true; |
| 88 | } else if (!strncmp(info->solver, "coord helper table for ", 23)) { | ||
| 89 | return true; | ||
| 85 | } else { | 90 | } else { |
| 86 | LOG("checkdata: unknown solver %s\n", info->solver); | 91 | LOG("checkdata: unknown solver %s\n", info->solver); |
| 87 | return false; | 92 | return false; |
diff --git a/src/solvers/coord/gendata.h b/src/solvers/coord/gendata.h index 9512b93..93ffc65 100644 --- a/src/solvers/coord/gendata.h +++ b/src/solvers/coord/gendata.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | STATIC size_t gendata_coord(const coord_t *, void *); | 1 | STATIC size_t gendata_coord(const coord_t *, void *); |
| 2 | STATIC int64_t gendata_coord_dispatch(const char *, void *); | 2 | STATIC int64_t gendata_coord_dispatch(const char *, void *); |
| 3 | STATIC tableinfo_t genptable_coord(const coord_t *, const void *, uint8_t *); | 3 | STATIC tableinfo_t genptable_coord(const coord_t *, const void *, uint8_t *); |
| 4 | STATIC void getdistribution_coord( | ||
| 5 | const uint8_t *, const char *, uint64_t [static INFO_DISTRIBUTION_LEN]); | ||
| 4 | STATIC uint8_t get_coord_pval(const coord_t *, const uint8_t *, uint64_t); | 6 | STATIC uint8_t get_coord_pval(const coord_t *, const uint8_t *, uint64_t); |
| 5 | STATIC void set_coord_pval(const coord_t *, uint8_t *, uint64_t, uint8_t); | 7 | STATIC void set_coord_pval(const coord_t *, uint8_t *, uint64_t, uint8_t); |
| 6 | 8 | ||
| @@ -122,6 +124,28 @@ genptable_coord(const coord_t *coord, const void *data, uint8_t *table) | |||
| 122 | return info; | 124 | return info; |
| 123 | } | 125 | } |
| 124 | 126 | ||
| 127 | STATIC void | ||
| 128 | getdistribution_coord( | ||
| 129 | const uint8_t *table, | ||
| 130 | const char *coord, | ||
| 131 | uint64_t distr[static INFO_DISTRIBUTION_LEN] | ||
| 132 | ) | ||
| 133 | { | ||
| 134 | uint8_t v; | ||
| 135 | uint64_t i; | ||
| 136 | coord_t *c; | ||
| 137 | |||
| 138 | memset(distr, 0, INFO_DISTRIBUTION_LEN * sizeof(uint64_t)); | ||
| 139 | |||
| 140 | if((c = parse_coord(coord, strlen(coord))) == NULL) | ||
| 141 | return; | ||
| 142 | |||
| 143 | for (i = 0; i < c->max; i++) { | ||
| 144 | v = get_coord_pval(c, table, i); | ||
| 145 | distr[v]++; | ||
| 146 | } | ||
| 147 | } | ||
| 148 | |||
| 125 | STATIC uint8_t | 149 | STATIC uint8_t |
| 126 | get_coord_pval(const coord_t *coord, const uint8_t *table, uint64_t i) | 150 | get_coord_pval(const coord_t *coord, const uint8_t *table, uint64_t i) |
| 127 | { | 151 | { |
diff --git a/src/solvers/h48/gendata_h48.h b/src/solvers/h48/gendata_h48.h index fe4b259..55db1be 100644 --- a/src/solvers/h48/gendata_h48.h +++ b/src/solvers/h48/gendata_h48.h | |||
| @@ -682,6 +682,7 @@ getdistribution_h48( | |||
| 682 | distr[val]++; | 682 | distr[val]++; |
| 683 | } | 683 | } |
| 684 | } | 684 | } |
| 685 | |||
| 685 | STATIC const uint32_t * | 686 | STATIC const uint32_t * |
| 686 | get_cocsepdata_constptr(const void *data) | 687 | get_cocsepdata_constptr(const void *data) |
| 687 | { | 688 | { |
