h48

A prototype for an optimal Rubik's cube solver, work in progress.
git clone https://git.tronto.net/h48
Download | Log | Files | Refs | README | LICENSE

commit cdf311166da0171c2787fb1745072cd14569ff4f
parent dd44adceed44bec3dc313b77ec6f69123dc59016
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date:   Sun, 25 Aug 2024 14:35:45 +0200

Refactor table generation

Diffstat:
Msrc/nissy.c | 63+++++++++++++++++++++++++++++++++++++++++++++++++--------------
Msrc/solvers/h48/gendata_full.h | 198++++++++++++++++++++++++++++++++++++++++++++-----------------------------------
Msrc/solvers/h48/solve.h | 11+++++++----
Mtest/112_gendata_h48/gendata_h48_tests.c | 51+++++++++++++++++++++++++++++----------------------
Mtest/113_gen_h48short/gen_h48short.c | 5+++++
Mtools/001_gendata_h48/gendata_h48.c | 4++--
6 files changed, 202 insertions(+), 130 deletions(-)

diff --git a/src/nissy.c b/src/nissy.c @@ -10,6 +10,7 @@ #include "nissy.h" +_static int parse_h48_options(const char *, uint8_t *, uint8_t *, uint8_t *); _static int64_t write_result(cube_t, char [static 22]); /* TODO: add option to get DR, maybe C-only, E-only, eo... */ @@ -22,6 +23,36 @@ struct { GETCUBE_OPTIONS(NULL, NULL) }; +_static int +parse_h48_options(const char *buf, uint8_t *h, uint8_t *k, uint8_t *maxdepth) +{ + int i; + + /* TODO temporarily, options are in the form "h;k;maxdepth" */ + if (h != NULL) + *h = atoi(buf); + for (i = 0; buf[i] != ';'; i++) + if (buf[i] == 0) + goto parse_h48_options_error; + if (k != NULL) + *k = atoi(&buf[i+1]); + for (i = i+1; buf[i] != ';'; i++) + if (buf[i] == 0) + goto parse_h48_options_error; + if (maxdepth != NULL) + *maxdepth = atoi(&buf[i+1]); + + return (*h <= 11 && (*k == 2 || *k == 4) && *maxdepth <= 20) ? 0 : 1; + +parse_h48_options_error: + *h = 0; + *k = 0; + *maxdepth = 0; + LOG("Error parsing options: must be in \"h;k;maxdepth\" format " + " (instead it was \"%s\")\n", buf); + return -1; +} + _static int64_t write_result(cube_t cube, char result[static 22]) { @@ -163,19 +194,19 @@ nissy_gendata( void *data ) { + int p; int64_t ret; - uint8_t i; gendata_h48_arg_t arg; arg.buf = data; if (!strcmp(solver, "h48")) { - /* options are in the form "h;k;maxdepth" */ - arg.h = atoi(options); - for (i = 0; options[i] != ';'; i++) ; - arg.k = atoi(&options[i+1]); - for (i = i+1; options[i] != ';'; i++) ; - arg.maxdepth = atoi(&options[i+1]); - ret = gendata_h48(&arg); + p = parse_h48_options(options, &arg.h, &arg.k, &arg.maxdepth); + if (p != 0) { + LOG("gendata: ould not parse options\n"); + ret = -1; + } else { + ret = gendata_h48(&arg); + } } else if (!strcmp(solver, "h48stats")) { arg.h = 0; arg.k = 4; @@ -204,8 +235,9 @@ nissy_solve( ) { cube_t c; + int p; int64_t ret; - int h; + uint8_t h, k; c = readcube_B32(cube); @@ -241,11 +273,14 @@ nissy_solve( /* TODO define and use solve_options_t */ if (!strcmp(solver, "h48")) { - h = atoi(options); /* TODO: better parsing */ - ret = solve_h48( - c, minmoves, maxmoves, maxsolutions, - (uint8_t)h, data, solutions); - ret = -1; + p = parse_h48_options(options, &h, &k, NULL); + if (p != 0) { + LOG("gendata: could not parse options\n"); + ret = -1; + } else { + ret = solve_h48(c, minmoves, maxmoves, maxsolutions, + h, k, data, solutions); + } } else if (!strcmp(solver, "h48stats")) { ret = solve_h48stats(c, maxmoves, data, solutions); } else if (!strcmp(solver, "simple")) { diff --git a/src/solvers/h48/gendata_full.h b/src/solvers/h48/gendata_full.h @@ -1,10 +1,11 @@ -#define ESEP_NOEO (COCSEP_CLASSES * (size_t)_12c4 * (size_t)_8c4) -#define ESEP_MAX(h) (ESEP_NOEO << (size_t)(h)) -#define ESEP_TABLESIZE(h, k) (ESEP_MAX((h)) / ((size_t)8 / (size_t)(k))) +#define H48_COORDMAX_NOEO (COCSEP_CLASSES * (size_t)_12c4 * (size_t)_8c4) +#define H48_COORDMAX(h) (H48_COORDMAX_NOEO << (size_t)(h)) +#define H48_TABLESIZE(h, k) (H48_COORDMAX((h)) / ((size_t)8 / (size_t)(k))) -#define ESEP_IND(i) ((uint32_t)(i) / UINT32_C(8)) -#define ESEP_SHIFT(i) (UINT32_C(4) * ((uint32_t)(i) % UINT32_C(8))) -#define ESEP_MASK(i) ((_bit_u32(4) - (uint32_t)(1)) << ESEP_SHIFT(i)) +#define H48_COEFF(k) (UINT32_C(32) / (uint32_t)(k)) +#define H48_INDEX(i, k) ((uint32_t)(i) / H48_COEFF(k)) +#define H48_SHIFT(i, k) ((uint32_t)(k) * ((uint32_t)(i) % H48_COEFF(k))) +#define H48_MASK(i, k) ((_bit_u32(k) - (uint32_t)(1)) << H48_SHIFT(i, k)) #define MAXLEN 20 @@ -31,7 +32,12 @@ typedef struct { uint8_t h; uint8_t k; uint8_t maxdepth; - void * buf; + void *buf; + uint32_t *info; + uint32_t *cocsepdata; + uint32_t *h48data; + uint64_t selfsim[COCSEP_CLASSES]; + cube_t crep[COCSEP_CLASSES]; } gendata_h48_arg_t; typedef struct { @@ -51,18 +57,18 @@ typedef struct { cube_t *crep; } bfsarg_esep_t; -_static_inline uint8_t get_esep_pval(const uint32_t *, int64_t); -_static_inline void set_esep_pval(uint32_t *, int64_t, uint8_t); +_static_inline uint8_t get_esep_pval(const uint32_t *, int64_t, uint8_t); +_static_inline void set_esep_pval(uint32_t *, int64_t, uint8_t, uint8_t); _static uint64_t gen_h48short(gendata_h48short_arg_t *); _static size_t gendata_h48(gendata_h48_arg_t *); -_static size_t gendata_h48h0k4(void *, uint8_t); +_static size_t gendata_h48h0k4(gendata_h48_arg_t *); _static int64_t gendata_h48h0k4_bfs(bfsarg_esep_t *); _static int64_t gendata_h48h0k4_bfs_fromdone(bfsarg_esep_t *); _static int64_t gendata_h48h0k4_bfs_fromnew(bfsarg_esep_t *); -_static size_t gendata_h48k2(void *, uint8_t, uint8_t); +_static size_t gendata_h48k2(gendata_h48_arg_t *); -_static_inline int8_t get_h48_bound(cube_t, uint32_t, uint8_t, uint32_t *); +_static_inline int8_t get_h48_bound(cube_t, uint32_t, uint8_t, uint8_t, uint32_t *); _static uint64_t gen_h48short(gendata_h48short_arg_t *arg) @@ -108,14 +114,32 @@ gen_h48short(gendata_h48short_arg_t *arg) _static size_t gendata_h48(gendata_h48_arg_t *arg) { + static const size_t infosize = 88; /* TODO: change to e.g. 1024 */ + + size_t cocsepsize, h48size; + + /* TODO: move info at the start */ + arg->cocsepdata = (uint32_t *)arg->buf; + cocsepsize = gendata_cocsep( + (void *)arg->cocsepdata, arg->selfsim, arg->crep); + arg->h48data = arg->cocsepdata + (cocsepsize / sizeof(uint32_t)); + arg->info = arg->h48data + + (H48_TABLESIZE(arg->h, arg->k) / sizeof(uint32_t)); + + if (arg->buf != NULL) + memset(arg->h48data, 0xFF, H48_TABLESIZE(arg->h, arg->k)); + if (arg->h == 0 && arg->k == 4) { - return gendata_h48h0k4(arg->buf, arg->maxdepth); + h48size = gendata_h48h0k4(arg); } else if (arg->k == 2) { - return gendata_h48k2(arg->buf, arg->h, arg->maxdepth); + h48size = gendata_h48k2(arg); + } else { + h48size = 0; + LOG("Cannot generate data for h = %" PRIu8 " and k = %" PRIu8 + " (not implemented yet)\n", arg->h, arg->k); } - LOG("Cannot generate data for h = %" PRIu8 " and k = %" PRIu8 - " (not implemented yet)\n", arg->h, arg->k); + return infosize + cocsepsize + h48size; } /* @@ -123,59 +147,61 @@ TODO description generating fixed table with h=0, k=4 */ _static size_t -gendata_h48h0k4(void *buf, uint8_t maxdepth) +gendata_h48h0k4(gendata_h48_arg_t *arg) { - uint32_t j, *buf32, *info, *cocsepdata; - bfsarg_esep_t arg; + uint32_t j; + bfsarg_esep_t bfsarg; int64_t sc, cc, esep_max; +/* uint64_t selfsim[COCSEP_CLASSES]; cube_t crep[COCSEP_CLASSES]; size_t cocsepsize, infosize; +*/ - if (buf == NULL) + if (arg->buf == NULL) goto gendata_h48h0k4_return_size; - - /* TODO: move info at start of tables (all tables!) */ +/* cocsepsize = gendata_cocsep(buf, selfsim, crep); infosize = 88; - esep_max = (int64_t)ESEP_MAX(0); cocsepdata = (uint32_t *)buf; buf32 = cocsepdata + cocsepsize / 4; - info = buf32 + (ESEP_TABLESIZE(0, 4) / sizeof(uint32_t)); - memset(buf32, 0xFF, ESEP_TABLESIZE(0, 4)); - - sc = coord_h48(solved, cocsepdata, 0); - set_esep_pval(buf32, sc, 0); - info[1] = 1; - arg = (bfsarg_esep_t) { - .cocsepdata = cocsepdata, - .buf32 = buf32, - .selfsim = selfsim, - .crep = crep + info = buf32 + (H48_TABLESIZE(0, 4) / sizeof(uint32_t)); + memset(buf32, 0xFF, H48_TABLESIZE(0, 4)); +*/ + + esep_max = (int64_t)H48_COORDMAX(0); + sc = coord_h48(solved, arg->cocsepdata, 0); + set_esep_pval(arg->h48data, sc, 4, 0); + arg->info[1] = 1; + bfsarg = (bfsarg_esep_t) { + .cocsepdata = arg->cocsepdata, + .buf32 = arg->h48data, + .selfsim = arg->selfsim, + .crep = arg->crep }; for ( - arg.done = 1, arg.depth = 1, cc = 0; - arg.done < esep_max && arg.depth <= maxdepth; - arg.depth++ + bfsarg.done = 1, bfsarg.depth = 1, cc = 0; + bfsarg.done < esep_max && bfsarg.depth <= arg->maxdepth; + bfsarg.depth++ ) { - LOG("esep: generating depth %" PRIu8 "\n", arg.depth); - cc = gendata_h48h0k4_bfs(&arg); - arg.done += cc; - info[arg.depth+1] = cc; + LOG("esep: generating depth %" PRIu8 "\n", bfsarg.depth); + cc = gendata_h48h0k4_bfs(&bfsarg); + bfsarg.done += cc; + arg->info[bfsarg.depth+1] = cc; LOG("found %" PRId64 "\n", cc); } - info[0] = arg.depth-1; + arg->info[0] = bfsarg.depth-1; LOG("h48 pruning table computed\n"); - LOG("Maximum pruning value: %" PRIu32 "\n", info[0]); + LOG("Maximum pruning value: %" PRIu32 "\n", arg->info[0]); LOG("Pruning value distribution:\n"); - for (j = 0; j <= info[0]; j++) - LOG("%" PRIu8 ":\t%" PRIu32 "\n", j, info[j+1]); + for (j = 0; j <= arg->info[0]; j++) + LOG("%" PRIu8 ":\t%" PRIu32 "\n", j, arg->info[j+1]); gendata_h48h0k4_return_size: - return cocsepsize + ESEP_TABLESIZE(0, 4) + infosize; + return H48_TABLESIZE(0, 4); } _static int64_t @@ -197,20 +223,20 @@ gendata_h48h0k4_bfs_fromdone(bfsarg_esep_t *arg) int64_t i, j, k; cube_t cube, moved; - for (i = 0, cc = 0; i < (int64_t)ESEP_MAX(0); i++) { - c = get_esep_pval(arg->buf32, i); + for (i = 0, cc = 0; i < (int64_t)H48_COORDMAX(0); i++) { + c = get_esep_pval(arg->buf32, i, 4); if (c != arg->depth - 1) continue; cube = invcoord_h48(i, arg->crep, 0); for (m = 0; m < 18; m++) { moved = move(cube, m); j = coord_h48(moved, arg->cocsepdata, 0); - if (get_esep_pval(arg->buf32, j) <= arg->depth) + if (get_esep_pval(arg->buf32, j, 4) <= arg->depth) continue; _foreach_h48sim(moved, arg->cocsepdata, arg->selfsim, 0, k = coord_h48(moved, arg->cocsepdata, 0); - x = get_esep_pval(arg->buf32, k); - set_esep_pval(arg->buf32, k, arg->depth); + x = get_esep_pval(arg->buf32, k, 4); + set_esep_pval(arg->buf32, k, 4, arg->depth); cc += x != arg->depth; ) } @@ -227,21 +253,21 @@ gendata_h48h0k4_bfs_fromnew(bfsarg_esep_t *arg) int64_t i, j; cube_t cube, moved; - for (i = 0, cc = 0; i < (int64_t)ESEP_MAX(0); i++) { - c = get_esep_pval(arg->buf32, i); + for (i = 0, cc = 0; i < (int64_t)H48_COORDMAX(0); i++) { + c = get_esep_pval(arg->buf32, i, 4); if (c != 0xF) continue; cube = invcoord_h48(i, arg->crep, 0); for (m = 0; m < 18; m++) { moved = move(cube, m); j = coord_h48(moved, arg->cocsepdata, 0); - x = get_esep_pval(arg->buf32, j); + x = get_esep_pval(arg->buf32, j, 4); if (x >= arg->depth) continue; _foreach_h48sim(cube, arg->cocsepdata, arg->selfsim, 0, j = coord_h48(cube, arg->cocsepdata, 0); - x = get_esep_pval(arg->buf32, j); - set_esep_pval(arg->buf32, j, arg->depth); + x = get_esep_pval(arg->buf32, j, 4); + set_esep_pval(arg->buf32, j, 4, arg->depth); cc += x == 0xF; ) break; /* Enough to find one, skip the rest */ @@ -252,11 +278,12 @@ gendata_h48h0k4_bfs_fromnew(bfsarg_esep_t *arg) } _static size_t -gendata_h48k2(void *buf, uint8_t h, uint8_t maxdepth) +gendata_h48k2(gendata_h48_arg_t *arg) { - static uint64_t capacity = 10000019; /* First prime after 1e8 */ - static uint64_t randomizer = 10000079; /* Second prime after 1e8 */ - static uint8_t base[] = { + static const uint8_t shortdepth = 8; + static const uint64_t capacity = 10000019; + static const uint64_t randomizer = 10000079; + static const uint8_t base[] = { [0] = 8, [1] = 8, [2] = 8, @@ -272,58 +299,53 @@ gendata_h48k2(void *buf, uint8_t h, uint8_t maxdepth) }; uint64_t nshort; - uint32_t *buf32, *info, *cocsepdata; - h48map_t depth8cubes; + h48map_t shortcubes; gendata_h48short_arg_t shortarg; - uint64_t selfsim[COCSEP_CLASSES]; - cube_t crep[COCSEP_CLASSES]; - size_t cocsepsize, infosize; - DBG_ASSERT(base[h] == 8, 0, "Only implemented for h <= 3 (base 8)\n"); + DBG_ASSERT(base[arg->h] == 8, 0, "Only implemented for h <= 3 (base 8)\n"); - if (buf == NULL) + if (arg->buf == NULL) goto gendata_h48k2_return_size; - cocsepdata = (uint32_t *)buf; - cocsepsize = gendata_cocsep(buf, selfsim, crep); - infosize = 88; - - h48map_create(&depth8cubes, capacity, randomizer); + LOG("Computing depth <=%" PRIu8 "\n", shortdepth) + h48map_create(&shortcubes, capacity, randomizer); shortarg = (gendata_h48short_arg_t) { - .maxdepth = 8, - .cocsepdata = cocsepdata, - .crep = crep, - .selfsim = selfsim, - .map = &depth8cubes + .maxdepth = shortdepth, + .cocsepdata = arg->cocsepdata, + .crep = arg->crep, + .selfsim = arg->selfsim, + .map = &shortcubes }; - nshort = gen_h48short(&shortarg); - LOG("%" PRIu64 "\n", nshort); + LOG("Found %" PRIu64 "\n", nshort); + + /* TODO: loop over map, set all found to 0, do 2 moves each */ + LOG("The rest is not implemented yet\n"); - h48map_destroy(&depth8cubes); + h48map_destroy(&shortcubes); gendata_h48k2_return_size: - return cocsepsize + ESEP_TABLESIZE(h, 2) + infosize; + return H48_TABLESIZE(arg->h, 2); } _static_inline uint8_t -get_esep_pval(const uint32_t *buf32, int64_t i) +get_esep_pval(const uint32_t *buf32, int64_t i, uint8_t k) { - return (buf32[ESEP_IND(i)] & ESEP_MASK(i)) >> ESEP_SHIFT(i); + return (buf32[H48_INDEX(i, k)] & H48_MASK(i, k)) >> H48_SHIFT(i, k); } _static_inline void -set_esep_pval(uint32_t *buf32, int64_t i, uint8_t val) +set_esep_pval(uint32_t *buf32, int64_t i, uint8_t k, uint8_t val) { - buf32[ESEP_IND(i)] = - (buf32[ESEP_IND(i)] & (~ESEP_MASK(i))) | (val << ESEP_SHIFT(i)); + buf32[H48_INDEX(i, k)] = (buf32[H48_INDEX(i, k)] & (~H48_MASK(i, k))) + | (val << H48_SHIFT(i, k)); } _static_inline int8_t -get_h48_bound(cube_t cube, uint32_t cdata, uint8_t h, uint32_t *h48data) +get_h48_bound(cube_t cube, uint32_t cdata, uint8_t h, uint8_t k, uint32_t *h48data) { int64_t coord; coord = coord_h48_edges(cube, COCLASS(cdata), TTREP(cdata), h); - return get_esep_pval(h48data, coord); + return get_esep_pval(h48data, coord, k); } diff --git a/src/solvers/h48/solve.h b/src/solvers/h48/solve.h @@ -7,6 +7,7 @@ typedef struct { int64_t *nsols; int64_t maxsolutions; uint8_t h; + uint8_t k; uint32_t *cocsepdata; uint32_t *h48data; char **nextsol; @@ -26,7 +27,7 @@ _static void solve_h48_appendsolution(dfsarg_solveh48_t *); _static_inline bool solve_h48_stop(dfsarg_solveh48_t *); _static int64_t solve_h48_dfs(dfsarg_solveh48_t *); _static int64_t solve_h48( - cube_t, int8_t, int8_t, int8_t, uint8_t, const void *, char *); + cube_t, int8_t, int8_t, int8_t, uint8_t, uint8_t, const void *, char *); _static int64_t solve_h48stats_dfs(dfsarg_solveh48stats_t *); _static int64_t solve_h48stats(cube_t, int8_t, const void *, char [static 12]); @@ -59,12 +60,12 @@ solve_h48_stop(dfsarg_solveh48_t *arg) return true; /* - bound = get_h48_bound(arg->cube, data, arg->h, arg->h48data); + bound = get_h48_bound(arg->cube, data, arg->h, arg->k, arg->h48data); LOG("Using pval %" PRId8 "\n", bound); if (bound + arg->nmoves > arg->depth) return true; - bound = get_h48_bound(arg->inverse, data_inv, arg->h, arg->h48data); + bound = get_h48_bound(arg->inverse, data_inv, arg->h, arg->k, arg->h48data); if (bound + arg->nmoves > arg->depth) return true; */ @@ -119,6 +120,7 @@ solve_h48( int8_t maxmoves, int8_t maxsolutions, uint8_t h, + uint8_t k, const void *data, char *solutions ) @@ -132,6 +134,7 @@ solve_h48( .nsols = &nsols, .maxsolutions = maxsolutions, .h = h, + .k = k, .cocsepdata = (uint32_t *)data, .h48data = ((uint32_t *)data) + COCSEP_FULLSIZE / 4, .nextsol = &solutions @@ -175,7 +178,7 @@ solve_h48stats_dfs(dfsarg_solveh48stats_t *arg) /* Check h48 lower bound for h=0 (esep, but no eo) */ coord = coord_h48_edges(arg->cube, COCLASS(d), TTREP(d), 0); - bound = get_esep_pval(arg->h48data, coord); + bound = get_esep_pval(arg->h48data, coord, 4); if (bound + arg->nmoves > arg->depth) return 0; diff --git a/test/112_gendata_h48/gendata_h48_tests.c b/test/112_gendata_h48/gendata_h48_tests.c @@ -1,43 +1,50 @@ #include "../test.h" +#define COCSEP_CLASSES 3393 #define COCSEPSIZE 1119792 -#define ETABLESIZE ((3393 * 495 * 70) >> 1) -int64_t gendata_h48h0k4(void *, uint8_t); +typedef struct { + uint8_t h; + uint8_t k; + uint8_t maxdepth; + void *buf; + uint32_t *info; + uint32_t *cocsepdata; + uint32_t *h48data; + uint64_t selfsim[COCSEP_CLASSES]; + cube_t crep[COCSEP_CLASSES]; +} gendata_h48_arg_t; -int64_t gendata_h48_fixture(void *buf, uint8_t maxdepth, uint8_t h) { - if (h == 0) - return gendata_h48h0k4(buf, maxdepth); - fprintf(stderr, "Error: gendata h48 for h>0 not implemented yet\n"); - exit(1); -} +int64_t gendata_h48(gendata_h48_arg_t *); void run(void) { char str[STRLENMAX]; - uint8_t i, maxdepth, h; - uint32_t *buf, *h48info; - size_t result; + uint8_t i; + gendata_h48_arg_t arg; + size_t result, sz; fgets(str, STRLENMAX, stdin); - maxdepth = atoi(str); + arg.maxdepth = atoi(str); fgets(str, STRLENMAX, stdin); - h = atoi(str); + arg.h = atoi(str); + arg.k = 4; - buf = (uint32_t *)malloc(sizeof(uint32_t) * 60000000); - result = gendata_h48_fixture(buf, maxdepth, h); - h48info = buf + (ETABLESIZE + COCSEPSIZE) / 4; + sz = gendata_h48(&arg); /* With buf = NULL returns data size */ + arg.buf = malloc(sz); + result = gendata_h48(&arg); 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]); + printf("Classes: %" PRIu32 "\n", arg.cocsepdata[COCSEPSIZE/4-12]); + printf("Max value: %" PRIu32 "\n", arg.cocsepdata[COCSEPSIZE/4-11]); for (i = 0; i < 10; i++) - printf("%" PRIu32 ": %" PRIu32 "\n", i, buf[COCSEPSIZE/4-10+i]); + printf("%" PRIu32 ": %" PRIu32 "\n", + i, arg.cocsepdata[COCSEPSIZE/4-10+i]); printf("\nh48:\n"); - for (i = 0; i < maxdepth+1; i++) - printf("%" PRIu32 ": %" PRIu32 "\n", i, h48info[i+1]); + for (i = 0; i < arg.maxdepth+1; i++) + printf("%" PRIu32 ": %" PRIu32 "\n", i, arg.info[i+1]); - free(buf); + free(arg.buf); } diff --git a/test/113_gen_h48short/gen_h48short.c b/test/113_gen_h48short/gen_h48short.c @@ -8,6 +8,11 @@ typedef struct { uint64_t capacity; uint64_t randomizer; uint64_t *table; + uint32_t *info; + uint32_t *cocsepdata; + uint32_t *h48data; + uint64_t selfsim[COCSEP_CLASSES]; + cube_t crep[COCSEP_CLASSES]; } h48map_t; typedef struct { diff --git a/tools/001_gendata_h48/gendata_h48.c b/tools/001_gendata_h48/gendata_h48.c @@ -3,8 +3,8 @@ #define MAXDEPTH 20 #define HVALUE 0 -#define OPTIONS "0;20" -#define LONGOPTIONS "h = 0, max depth = 20" +#define OPTIONS "0;4;20" +#define LONGOPTIONS "h = 0, k = 4, max depth = 20" #define COCSEPSIZE 1119792 #define ETABLESIZE(h) (((3393 * 495 * 70) >> 1) << (size_t)(h))