diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-08-26 21:42:50 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-08-26 21:42:50 +0200 |
| commit | c558c7989eaa0921f7b29ee274b325f4f6d97f8c (patch) | |
| tree | 3f8393c5d8c492ed4600198501f7ecfb28fd6363 /test/113_gen_h48short | |
| parent | f2907e471b3caddc5844bc6994e1cbd249019747 (diff) | |
| download | nissy-core-c558c7989eaa0921f7b29ee274b325f4f6d97f8c.tar.gz nissy-core-c558c7989eaa0921f7b29ee274b325f4f6d97f8c.zip | |
Gendata added for h48k2, need to verify with new tool
Diffstat (limited to 'test/113_gen_h48short')
| -rw-r--r-- | test/113_gen_h48short/00_depth_1.in | 28 | ||||
| -rw-r--r-- | test/113_gen_h48short/00_depth_1.out | 3 | ||||
| -rw-r--r-- | test/113_gen_h48short/01_depth_3.in | 3 | ||||
| -rw-r--r-- | test/113_gen_h48short/01_depth_3.out | 40 | ||||
| -rw-r--r-- | test/113_gen_h48short/gen_h48short.c | 87 |
5 files changed, 0 insertions, 161 deletions
diff --git a/test/113_gen_h48short/00_depth_1.in b/test/113_gen_h48short/00_depth_1.in deleted file mode 100644 index c86f15b..0000000 --- a/test/113_gen_h48short/00_depth_1.in +++ /dev/null | |||
| @@ -1,28 +0,0 @@ | |||
| 1 | 73 | ||
| 2 | 157 | ||
| 3 | 1 | ||
| 4 | |||
| 5 | For longer test: | ||
| 6 | |||
| 7 | 20000003 | ||
| 8 | 20000023 | ||
| 9 | 8 | ||
| 10 | |||
| 11 | Short h48: generating depth 0 | ||
| 12 | found 1 | ||
| 13 | Short h48: generating depth 1 | ||
| 14 | found 1 | ||
| 15 | Short h48: generating depth 2 | ||
| 16 | found 4 | ||
| 17 | Short h48: generating depth 3 | ||
| 18 | found 34 | ||
| 19 | Short h48: generating depth 4 | ||
| 20 | found 333 | ||
| 21 | Short h48: generating depth 5 | ||
| 22 | found 3815 | ||
| 23 | Short h48: generating depth 6 | ||
| 24 | found 45382 | ||
| 25 | Short h48: generating depth 7 | ||
| 26 | found 548562 | ||
| 27 | Short h48: generating depth 8 | ||
| 28 | found 6839723 | ||
diff --git a/test/113_gen_h48short/00_depth_1.out b/test/113_gen_h48short/00_depth_1.out deleted file mode 100644 index b0dba31..0000000 --- a/test/113_gen_h48short/00_depth_1.out +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | 2 | ||
| 2 | 0 0 | ||
| 3 | 71075840 1 | ||
diff --git a/test/113_gen_h48short/01_depth_3.in b/test/113_gen_h48short/01_depth_3.in deleted file mode 100644 index 920e70a..0000000 --- a/test/113_gen_h48short/01_depth_3.in +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | 73 | ||
| 2 | 157 | ||
| 3 | 3 | ||
diff --git a/test/113_gen_h48short/01_depth_3.out b/test/113_gen_h48short/01_depth_3.out deleted file mode 100644 index dbce376..0000000 --- a/test/113_gen_h48short/01_depth_3.out +++ /dev/null | |||
| @@ -1,40 +0,0 @@ | |||
| 1 | 40 | ||
| 2 | 0 0 | ||
| 3 | 70981632 3 | ||
| 4 | 71075840 1 | ||
| 5 | 71086080 3 | ||
| 6 | 142067712 2 | ||
| 7 | 218789888 3 | ||
| 8 | 218884096 2 | ||
| 9 | 283879424 2 | ||
| 10 | 283899904 3 | ||
| 11 | 283953152 3 | ||
| 12 | 283973632 2 | ||
| 13 | 360548808 3 | ||
| 14 | 360835072 3 | ||
| 15 | 473668032 3 | ||
| 16 | 473956352 3 | ||
| 17 | 499869696 3 | ||
| 18 | 500011008 3 | ||
| 19 | 598679552 3 | ||
| 20 | 599109185 3 | ||
| 21 | 662171648 3 | ||
| 22 | 662601226 3 | ||
| 23 | 724818316 3 | ||
| 24 | 725106688 3 | ||
| 25 | 790513664 3 | ||
| 26 | 790607872 3 | ||
| 27 | 904991108 3 | ||
| 28 | 926726144 3 | ||
| 29 | 928729088 3 | ||
| 30 | 1009662340 3 | ||
| 31 | 1088755203 3 | ||
| 32 | 1171758595 3 | ||
| 33 | 1206452224 3 | ||
| 34 | 1206480896 3 | ||
| 35 | 1277360128 3 | ||
| 36 | 1277454336 3 | ||
| 37 | 1403695492 3 | ||
| 38 | 1403697540 3 | ||
| 39 | 1403736452 3 | ||
| 40 | 1403738500 3 | ||
diff --git a/test/113_gen_h48short/gen_h48short.c b/test/113_gen_h48short/gen_h48short.c deleted file mode 100644 index 335821a..0000000 --- a/test/113_gen_h48short/gen_h48short.c +++ /dev/null | |||
| @@ -1,87 +0,0 @@ | |||
| 1 | #include "../test.h" | ||
| 2 | |||
| 3 | #define COCSEP_CLASSES 3393 | ||
| 4 | #define MAXPOS 200 | ||
| 5 | |||
| 6 | typedef struct { | ||
| 7 | uint64_t n; | ||
| 8 | uint64_t capacity; | ||
| 9 | uint64_t randomizer; | ||
| 10 | uint64_t *table; | ||
| 11 | uint32_t *info; | ||
| 12 | uint32_t *cocsepdata; | ||
| 13 | uint32_t *h48data; | ||
| 14 | uint64_t selfsim[COCSEP_CLASSES]; | ||
| 15 | cube_t crep[COCSEP_CLASSES]; | ||
| 16 | } h48map_t; | ||
| 17 | |||
| 18 | typedef struct { | ||
| 19 | uint64_t key; | ||
| 20 | uint64_t val; | ||
| 21 | } kvpair_t; | ||
| 22 | |||
| 23 | typedef struct { | ||
| 24 | uint8_t maxdepth; | ||
| 25 | const uint32_t *cocsepdata; | ||
| 26 | const cube_t *crep; | ||
| 27 | const uint64_t *selfsim; | ||
| 28 | h48map_t *map; | ||
| 29 | } gendata_h48short_arg_t; | ||
| 30 | |||
| 31 | void h48map_create(h48map_t *, uint64_t, uint64_t); | ||
| 32 | void h48map_destroy(h48map_t *); | ||
| 33 | kvpair_t h48map_nextkvpair(h48map_t *, uint64_t *); | ||
| 34 | size_t gendata_cocsep(void *, uint64_t *, cube_t *); | ||
| 35 | uint64_t gen_h48short(gendata_h48short_arg_t *); | ||
| 36 | |||
| 37 | char str[STRLENMAX]; | ||
| 38 | |||
| 39 | int compare(const void *x, const void *y) { | ||
| 40 | uint64_t a = ((kvpair_t *)x)->key; | ||
| 41 | uint64_t b = ((kvpair_t *)y)->key; | ||
| 42 | |||
| 43 | if (a > b) return 1; | ||
| 44 | if (a == b) return 0; | ||
| 45 | return -1; | ||
| 46 | } | ||
| 47 | |||
| 48 | uint64_t readl(void) { | ||
| 49 | fgets(str, STRLENMAX, stdin); | ||
| 50 | return atoll(str); | ||
| 51 | } | ||
| 52 | |||
| 53 | void run(void) { | ||
| 54 | uint32_t cocsepdata[300000]; | ||
| 55 | h48map_t map; | ||
| 56 | uint64_t i, j, capacity, randomizer, selfsim[COCSEP_CLASSES]; | ||
| 57 | kvpair_t kv, b[MAXPOS]; | ||
| 58 | gendata_h48short_arg_t arg; | ||
| 59 | cube_t crep[COCSEP_CLASSES]; | ||
| 60 | |||
| 61 | capacity = readl(); | ||
| 62 | randomizer = readl(); | ||
| 63 | arg.maxdepth = readl(); | ||
| 64 | arg.cocsepdata = cocsepdata; | ||
| 65 | arg.crep = crep; | ||
| 66 | arg.selfsim = selfsim; | ||
| 67 | arg.map = ↦ | ||
| 68 | |||
| 69 | h48map_create(&map, capacity, randomizer); | ||
| 70 | gendata_cocsep(cocsepdata, selfsim, crep); | ||
| 71 | gen_h48short(&arg); | ||
| 72 | |||
| 73 | i = 0; | ||
| 74 | for (kv = h48map_nextkvpair(&map, &i), j = 0; | ||
| 75 | i != map.capacity && j < MAXPOS; | ||
| 76 | kv = h48map_nextkvpair(&map, &i) | ||
| 77 | ) { | ||
| 78 | b[j++] = kv; | ||
| 79 | } | ||
| 80 | qsort(b, j, sizeof(kvpair_t), compare); | ||
| 81 | |||
| 82 | printf("%" PRIu64 "\n", map.n); | ||
| 83 | for (i = 0; i < j; i++) | ||
| 84 | printf("%" PRIu64 " %" PRIu64 "\n", b[i].key, b[i].val); | ||
| 85 | |||
| 86 | h48map_destroy(&map); | ||
| 87 | } | ||
