diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-08-25 10:27:21 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-08-25 10:27:21 +0200 |
| commit | dd44adceed44bec3dc313b77ec6f69123dc59016 (patch) | |
| tree | bef73833770b191e113f90c4aa3d6b1683b35ba2 /test | |
| parent | 9c5bdcb09dc56104f7ea34c71a9418c7908ed227 (diff) | |
| download | nissy-core-dd44adceed44bec3dc313b77ec6f69123dc59016.tar.gz nissy-core-dd44adceed44bec3dc313b77ec6f69123dc59016.zip | |
Started work on k=2 tables; further split h48 gendata
Diffstat (limited to 'test')
| -rw-r--r-- | test/113_gen_h48short/gen_h48short.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/test/113_gen_h48short/gen_h48short.c b/test/113_gen_h48short/gen_h48short.c index 399ef1e..92d346a 100644 --- a/test/113_gen_h48short/gen_h48short.c +++ b/test/113_gen_h48short/gen_h48short.c | |||
| @@ -15,12 +15,19 @@ typedef struct { | |||
| 15 | uint64_t val; | 15 | uint64_t val; |
| 16 | } kvpair_t; | 16 | } kvpair_t; |
| 17 | 17 | ||
| 18 | typedef struct { | ||
| 19 | uint8_t maxdepth; | ||
| 20 | const uint32_t *cocsepdata; | ||
| 21 | const cube_t *crep; | ||
| 22 | const uint64_t *selfsim; | ||
| 23 | h48map_t *map; | ||
| 24 | } gendata_h48short_arg_t; | ||
| 25 | |||
| 18 | void h48map_create(h48map_t *, uint64_t, uint64_t); | 26 | void h48map_create(h48map_t *, uint64_t, uint64_t); |
| 19 | void h48map_destroy(h48map_t *); | 27 | void h48map_destroy(h48map_t *); |
| 20 | kvpair_t h48map_nextkvpair(h48map_t *, uint64_t *); | 28 | kvpair_t h48map_nextkvpair(h48map_t *, uint64_t *); |
| 21 | size_t gendata_cocsep(void *, uint64_t *, cube_t *); | 29 | size_t gendata_cocsep(void *, uint64_t *, cube_t *); |
| 22 | uint64_t gen_h48short( | 30 | uint64_t gen_h48short(gendata_h48short_arg_t *); |
| 23 | uint8_t, const uint32_t *, const cube_t *, const uint64_t *, h48map_t *); | ||
| 24 | 31 | ||
| 25 | char str[STRLENMAX]; | 32 | char str[STRLENMAX]; |
| 26 | 33 | ||
| @@ -41,17 +48,22 @@ uint64_t readl(void) { | |||
| 41 | void run(void) { | 48 | void run(void) { |
| 42 | uint32_t cocsepdata[300000]; | 49 | uint32_t cocsepdata[300000]; |
| 43 | h48map_t map; | 50 | h48map_t map; |
| 44 | uint64_t n, i, j, capacity, randomizer, selfsim[COCSEP_CLASSES]; | 51 | uint64_t i, j, capacity, randomizer, selfsim[COCSEP_CLASSES]; |
| 45 | kvpair_t kv, b[MAXPOS]; | 52 | kvpair_t kv, b[MAXPOS]; |
| 53 | gendata_h48short_arg_t arg; | ||
| 46 | cube_t crep[COCSEP_CLASSES]; | 54 | cube_t crep[COCSEP_CLASSES]; |
| 47 | 55 | ||
| 48 | capacity = readl(); | 56 | capacity = readl(); |
| 49 | randomizer = readl(); | 57 | randomizer = readl(); |
| 50 | n = readl(); | 58 | arg.maxdepth = readl(); |
| 59 | arg.cocsepdata = cocsepdata; | ||
| 60 | arg.crep = crep; | ||
| 61 | arg.selfsim = selfsim; | ||
| 62 | arg.map = ↦ | ||
| 51 | 63 | ||
| 52 | h48map_create(&map, capacity, randomizer); | 64 | h48map_create(&map, capacity, randomizer); |
| 53 | gendata_cocsep(cocsepdata, selfsim, crep); | 65 | gendata_cocsep(cocsepdata, selfsim, crep); |
| 54 | gen_h48short(n, cocsepdata, crep, selfsim, &map); | 66 | gen_h48short(&arg); |
| 55 | 67 | ||
| 56 | i = 0; | 68 | i = 0; |
| 57 | for (kv = h48map_nextkvpair(&map, &i), j = 0; | 69 | for (kv = h48map_nextkvpair(&map, &i), j = 0; |
