From c2275e4b9625a1a19eb50d0880f70ed583d5c358 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Mon, 8 Jul 2024 19:22:16 +0200 Subject: Stats for h48 solver as tool --- test/103_gendata_h48/00_h_0.in | 1 - test/103_gendata_h48/00_h_0.out | 23 ------------------- test/103_gendata_h48/01_h_1.in | 1 - test/103_gendata_h48/01_h_1.out | 23 ------------------- test/103_gendata_h48/gendata_h48_tests.c | 34 ----------------------------- test/103_gendata_h48_h0/00_h_0.in | 0 test/103_gendata_h48_h0/00_h_0.out | 23 +++++++++++++++++++ test/103_gendata_h48_h0/gendata_h48_tests.c | 33 ++++++++++++++++++++++++++++ 8 files changed, 56 insertions(+), 82 deletions(-) delete mode 100644 test/103_gendata_h48/00_h_0.in delete mode 100644 test/103_gendata_h48/00_h_0.out delete mode 100644 test/103_gendata_h48/01_h_1.in delete mode 100644 test/103_gendata_h48/01_h_1.out delete mode 100644 test/103_gendata_h48/gendata_h48_tests.c create mode 100644 test/103_gendata_h48_h0/00_h_0.in create mode 100644 test/103_gendata_h48_h0/00_h_0.out create mode 100644 test/103_gendata_h48_h0/gendata_h48_tests.c (limited to 'test') diff --git a/test/103_gendata_h48/00_h_0.in b/test/103_gendata_h48/00_h_0.in deleted file mode 100644 index 573541a..0000000 --- a/test/103_gendata_h48/00_h_0.in +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/test/103_gendata_h48/00_h_0.out b/test/103_gendata_h48/00_h_0.out deleted file mode 100644 index cc5cf9b..0000000 --- a/test/103_gendata_h48/00_h_0.out +++ /dev/null @@ -1,23 +0,0 @@ -59903605 - -cocsepdata: -Classes: 3393 -Max value: 9 -0: 1 -1: 6 -2: 63 -3: 468 -4: 3068 -5: 15438 -6: 53814 -7: 71352 -8: 8784 -9: 96 - -h48: -0: 1 -1: 1 -2: 4 -3: 34 -4: 329 -5: 3587 diff --git a/test/103_gendata_h48/01_h_1.in b/test/103_gendata_h48/01_h_1.in deleted file mode 100644 index d00491f..0000000 --- a/test/103_gendata_h48/01_h_1.in +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/test/103_gendata_h48/01_h_1.out b/test/103_gendata_h48/01_h_1.out deleted file mode 100644 index bd0931c..0000000 --- a/test/103_gendata_h48/01_h_1.out +++ /dev/null @@ -1,23 +0,0 @@ -118687330 - -cocsepdata: -Classes: 3393 -Max value: 9 -0: 1 -1: 6 -2: 63 -3: 468 -4: 3068 -5: 15438 -6: 53814 -7: 71352 -8: 8784 -9: 96 - -h48: -0: 1 -1: 1 -2: 4 -3: 34 -4: 375 -5: 4078 diff --git a/test/103_gendata_h48/gendata_h48_tests.c b/test/103_gendata_h48/gendata_h48_tests.c deleted file mode 100644 index 666f9f6..0000000 --- a/test/103_gendata_h48/gendata_h48_tests.c +++ /dev/null @@ -1,34 +0,0 @@ -#include "../test.h" - -#define MAXDEPTH 5 -#define COCSEPSIZE 1119792 -#define ETABLESIZE(h) (((3393 * 495 * 70) >> 1) << (size_t)(h)) - -size_t gendata_h48(void *, uint8_t, uint8_t); - -void run(void) { - char str[STRLENMAX]; - uint8_t h, i; - uint32_t *buf, *h48info; - size_t result; - - fgets(str, STRLENMAX, stdin); - h = atoi(str); - buf = (uint32_t *)malloc(sizeof(uint32_t) * (60000000 << h)); - result = gendata_h48(buf, h, MAXDEPTH); - h48info = buf + (ETABLESIZE(h) + COCSEPSIZE) / 4; - - printf("%zu\n\n", result); - - printf("cocsepdata:\n"); - printf("Classes: %" PRIu32 "\n", buf[COCSEPSIZE/4-12]); - printf("Max value: %" PRIu32 "\n", buf[COCSEPSIZE/4-11]); - for (i = 0; i < 10; i++) - printf("%" PRIu32 ": %" PRIu32 "\n", i, buf[COCSEPSIZE/4-10+i]); - - printf("\nh48:\n"); - for (i = 0; i < MAXDEPTH+1; i++) - printf("%" PRIu32 ": %" PRIu32 "\n", i, h48info[i+1]); - - free(buf); -} diff --git a/test/103_gendata_h48_h0/00_h_0.in b/test/103_gendata_h48_h0/00_h_0.in new file mode 100644 index 0000000..e69de29 diff --git a/test/103_gendata_h48_h0/00_h_0.out b/test/103_gendata_h48_h0/00_h_0.out new file mode 100644 index 0000000..cc5cf9b --- /dev/null +++ b/test/103_gendata_h48_h0/00_h_0.out @@ -0,0 +1,23 @@ +59903605 + +cocsepdata: +Classes: 3393 +Max value: 9 +0: 1 +1: 6 +2: 63 +3: 468 +4: 3068 +5: 15438 +6: 53814 +7: 71352 +8: 8784 +9: 96 + +h48: +0: 1 +1: 1 +2: 4 +3: 34 +4: 329 +5: 3587 diff --git a/test/103_gendata_h48_h0/gendata_h48_tests.c b/test/103_gendata_h48_h0/gendata_h48_tests.c new file mode 100644 index 0000000..ed17915 --- /dev/null +++ b/test/103_gendata_h48_h0/gendata_h48_tests.c @@ -0,0 +1,33 @@ +#include "../test.h" + +#define MAXDEPTH 5 +#define COCSEPSIZE 1119792 +#define ETABLESIZE ((3393 * 495 * 70) >> 1) + +size_t gendata_h48h0k4(void *, uint8_t); + +void run(void) { + char str[STRLENMAX]; + uint8_t i; + uint32_t *buf, *h48info; + size_t result; + + fgets(str, STRLENMAX, stdin); + buf = (uint32_t *)malloc(sizeof(uint32_t) * 60000000); + result = gendata_h48h0k4(buf, MAXDEPTH); + h48info = buf + (ETABLESIZE + COCSEPSIZE) / 4; + + printf("%zu\n\n", result); + + printf("cocsepdata:\n"); + printf("Classes: %" PRIu32 "\n", buf[COCSEPSIZE/4-12]); + printf("Max value: %" PRIu32 "\n", buf[COCSEPSIZE/4-11]); + for (i = 0; i < 10; i++) + printf("%" PRIu32 ": %" PRIu32 "\n", i, buf[COCSEPSIZE/4-10+i]); + + printf("\nh48:\n"); + for (i = 0; i < MAXDEPTH+1; i++) + printf("%" PRIu32 ": %" PRIu32 "\n", i, h48info[i+1]); + + free(buf); +} -- cgit v1.3