From 2f924f942bd6e7126e8f1d8692e475c95bd9fe82 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Thu, 16 Dec 2021 19:25:58 +0100 Subject: Added a new pruning table (equivalent to nxopt31). I have not tested it yet, it takes a while to generate. Plus I have done a whole lot of refactoring in random places because I cannot focus on one thing at the time. --- src/symcoord.c | 85 +++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 57 insertions(+), 28 deletions(-) (limited to 'src/symcoord.c') diff --git a/src/symcoord.c b/src/symcoord.c index 038449a..707a84e 100644 --- a/src/symcoord.c +++ b/src/symcoord.c @@ -4,23 +4,24 @@ #define CLASSES_CP_16 2768 #define CLASSES_EOFBEPOS_16 64430 -static Cube antindex_coud_sym16(uint64_t ind); static Cube antindex_cp_sym16(uint64_t ind); static Cube antindex_eofbepos_sym16(uint64_t ind); static Cube antindex_drud_sym16(uint64_t ind); static Cube antindex_drudfin_noE_sym16(uint64_t ind); static Cube antindex_khuge(uint64_t ind); +static Cube antindex_nxopt31(uint64_t ind); -static uint64_t index_coud_sym16(Cube cube); static uint64_t index_cp_sym16(Cube cube); static uint64_t index_eofbepos_sym16(Cube cube); static uint64_t index_drud_sym16(Cube cube); static uint64_t index_drudfin_noE_sym16(Cube cube); static uint64_t index_khuge(Cube cube); +static uint64_t index_nxopt31(Cube cube); static int transfinder_drud_sym16(uint64_t ind, Trans *ret); static int transfinder_drudfin_noE_sym16(uint64_t ind, Trans *ret); static int transfinder_khuge(uint64_t ind, Trans *ret); +static int transfinder_nxopt31(uint64_t ind, Trans *ret); static void gensym(SymData *sd); static bool read_symdata_file(SymData *sd); @@ -37,15 +38,6 @@ trans_group_udfix[16] = { df_mirror, dr_mirror, db_mirror, dl_mirror, }; -static SymData -sd_coud_16 = { - .filename = "sd_coud_16", - .coord = &coord_coud, - .sym_coord = &coord_coud_sym16, - .ntrans = 16, - .trans = trans_group_udfix -}; - static SymData sd_cp_16 = { .filename = "sd_cp_16", @@ -64,9 +56,8 @@ sd_eofbepos_16 = { .trans = trans_group_udfix }; -static int nsymdata = 3; +static int nsymdata = 2; static SymData * all_sd[] = { - &sd_coud_16, &sd_cp_16, &sd_eofbepos_16, }; @@ -80,12 +71,6 @@ coord_eofbepos_sym16 = { .cube = antindex_eofbepos_sym16, }; -Coordinate -coord_coud_sym16 = { - .index = index_coud_sym16, - .cube = antindex_coud_sym16, -}; - Coordinate coord_cp_sym16 = { .index = index_cp_sym16, @@ -116,13 +101,15 @@ coord_khuge = { .trans = transfinder_khuge, }; -/* Functions *****************************************************************/ +Coordinate +coord_nxopt31 = { + .index = index_nxopt31, + .cube = antindex_nxopt31, + .max = POW3TO7 * BINOM8ON4 * CLASSES_EOFBEPOS_16 , + .trans = transfinder_nxopt31, +}; -static Cube -antindex_coud_sym16(uint64_t ind) -{ - return sd_coud_16.rep[ind]; -} +/* Functions *****************************************************************/ static Cube antindex_cp_sym16(uint64_t ind) @@ -173,10 +160,16 @@ antindex_khuge(uint64_t ind) return c; } -static uint64_t -index_coud_sym16(Cube cube) +static Cube +antindex_nxopt31(uint64_t ind) { - return sd_coud_16.class[coord_coud.index(cube)]; + Cube c; + + c = antindex_eofbepos_sym16(ind/(BINOM8ON4*POW3TO7)); + c.cp = coord_cpud_separate.cube((ind/POW3TO7)%BINOM8ON4).cp; + c.coud = ind % POW3TO7; + + return c; } static uint64_t @@ -229,6 +222,20 @@ index_khuge(Cube cube) return a * POW3TO7 + c.coud; } +static uint64_t +index_nxopt31(Cube cube) +{ + Trans t; + Cube c; + uint64_t a; + + t = sd_eofbepos_16.transtorep[coord_eofbepos.index(cube)]; + c = apply_trans(t, cube); + a = (index_eofbepos_sym16(c)*BINOM8ON4) + coord_cpud_separate.index(c); + + return a * POW3TO7 + c.coud; +} + static int transfinder_drud_sym16(uint64_t ind, Trans *ret) { @@ -295,6 +302,28 @@ transfinder_khuge(uint64_t ind, Trans *ret) return naux[trueind]; } +static int +transfinder_nxopt31(uint64_t ind, Trans *ret) +{ + uint64_t i, trueind; + int j; + static bool initialized = false; + static int naux[CLASSES_EOFBEPOS_16]; + static Trans retaux[CLASSES_EOFBEPOS_16][NTRANS]; + + if (!initialized) { + for (i = 0; i < CLASSES_EOFBEPOS_16; i++) + naux[i] = selfsims(&sd_eofbepos_16, i, retaux[i]); + + initialized = true; + } + + trueind = ind/(BINOM8ON4*POW3TO7); + for (j = 0; j < naux[trueind]; j++) + ret[j] = retaux[trueind][j]; + return naux[trueind]; +} + /* Other functions ***********************************************************/ static void -- cgit v1.3