diff options
Diffstat (limited to 'src/solvers/coord/gendata.h')
| -rw-r--r-- | src/solvers/coord/gendata.h | 24 |
1 files changed, 24 insertions, 0 deletions
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 | { |
