From 70d3a3de3a2fdef7e47b2bd510261d69390a3a9c Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Tue, 10 Sep 2024 19:43:05 +0200 Subject: New tableinfo for gendata_h48, still work to do --- test/100_gendata_cocsep/00_all.out | 2 +- test/100_gendata_cocsep/gendata_cocsep_tests.c | 35 ++++++++++++++++++++++---- 2 files changed, 31 insertions(+), 6 deletions(-) (limited to 'test/100_gendata_cocsep') diff --git a/test/100_gendata_cocsep/00_all.out b/test/100_gendata_cocsep/00_all.out index e14b938..82eb6c2 100644 --- a/test/100_gendata_cocsep/00_all.out +++ b/test/100_gendata_cocsep/00_all.out @@ -1,4 +1,4 @@ -1119792 +1120256 Classes: 3393 Max value: 9 0: 1 diff --git a/test/100_gendata_cocsep/gendata_cocsep_tests.c b/test/100_gendata_cocsep/gendata_cocsep_tests.c index 4a29ebb..ee26de9 100644 --- a/test/100_gendata_cocsep/gendata_cocsep_tests.c +++ b/test/100_gendata_cocsep/gendata_cocsep_tests.c @@ -1,20 +1,45 @@ #include "../test.h" -#define COCSEP_CLASSES 3393 +#define INFOSIZE 512 +#define INFO_SOLVER_STRLEN 100 +#define INFO_DISTRIBUTION_LEN 21 +#define COCSEP_CLASSES 3393 + +typedef struct { + char solver[INFO_SOLVER_STRLEN]; + uint64_t type; + uint64_t infosize; + uint64_t fullsize; + uint64_t hash; + uint64_t entries; + uint64_t classes; /* Used only by cocsepdata, for now */ + uint8_t bits; + uint8_t base; + uint8_t maxvalue; + uint64_t next; + uint64_t distribution[INFO_DISTRIBUTION_LEN]; +} tableinfo_t; size_t gendata_cocsep(void *, uint64_t *, cube_t *); +bool readtableinfo(const void *, tableinfo_t *); void run(void) { - uint32_t buf[300000], i; + char buf[2000000]; + uint32_t i; uint64_t selfsim[COCSEP_CLASSES]; cube_t rep[COCSEP_CLASSES]; size_t result; + tableinfo_t info; result = gendata_cocsep(buf, selfsim, rep); + if (!readtableinfo(buf, &info)) { + printf("Error reading info from table\n"); + return; + } printf("%zu\n", result); - printf("Classes: %" PRIu32 "\n", buf[result/4-12]); - printf("Max value: %" PRIu32 "\n", buf[result/4-11]); + printf("Classes: %" PRIu64 "\n", info.classes); + printf("Max value: %" PRIu8 "\n", info.maxvalue); for (i = 0; i < 10; i++) - printf("%" PRIu32 ": %" PRIu32 "\n", i, buf[result/4-10+i]); + printf("%" PRIu32 ": %" PRIu64 "\n", i, info.distribution[i]); } -- cgit v1.3