From dd44adceed44bec3dc313b77ec6f69123dc59016 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sun, 25 Aug 2024 10:27:21 +0200 Subject: Started work on k=2 tables; further split h48 gendata --- test/113_gen_h48short/gen_h48short.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'test') 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 { uint64_t val; } kvpair_t; +typedef struct { + uint8_t maxdepth; + const uint32_t *cocsepdata; + const cube_t *crep; + const uint64_t *selfsim; + h48map_t *map; +} gendata_h48short_arg_t; + void h48map_create(h48map_t *, uint64_t, uint64_t); void h48map_destroy(h48map_t *); kvpair_t h48map_nextkvpair(h48map_t *, uint64_t *); size_t gendata_cocsep(void *, uint64_t *, cube_t *); -uint64_t gen_h48short( - uint8_t, const uint32_t *, const cube_t *, const uint64_t *, h48map_t *); +uint64_t gen_h48short(gendata_h48short_arg_t *); char str[STRLENMAX]; @@ -41,17 +48,22 @@ uint64_t readl(void) { void run(void) { uint32_t cocsepdata[300000]; h48map_t map; - uint64_t n, i, j, capacity, randomizer, selfsim[COCSEP_CLASSES]; + uint64_t i, j, capacity, randomizer, selfsim[COCSEP_CLASSES]; kvpair_t kv, b[MAXPOS]; + gendata_h48short_arg_t arg; cube_t crep[COCSEP_CLASSES]; capacity = readl(); randomizer = readl(); - n = readl(); + arg.maxdepth = readl(); + arg.cocsepdata = cocsepdata; + arg.crep = crep; + arg.selfsim = selfsim; + arg.map = ↦ h48map_create(&map, capacity, randomizer); gendata_cocsep(cocsepdata, selfsim, crep); - gen_h48short(n, cocsepdata, crep, selfsim, &map); + gen_h48short(&arg); i = 0; for (kv = h48map_nextkvpair(&map, &i), j = 0; -- cgit v1.3