diff options
Diffstat (limited to '')
| -rw-r--r-- | src/symcoord.c | 85 |
1 files changed, 57 insertions, 28 deletions
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 @@ | |||
| 4 | #define CLASSES_CP_16 2768 | 4 | #define CLASSES_CP_16 2768 |
| 5 | #define CLASSES_EOFBEPOS_16 64430 | 5 | #define CLASSES_EOFBEPOS_16 64430 |
| 6 | 6 | ||
| 7 | static Cube antindex_coud_sym16(uint64_t ind); | ||
| 8 | static Cube antindex_cp_sym16(uint64_t ind); | 7 | static Cube antindex_cp_sym16(uint64_t ind); |
| 9 | static Cube antindex_eofbepos_sym16(uint64_t ind); | 8 | static Cube antindex_eofbepos_sym16(uint64_t ind); |
| 10 | static Cube antindex_drud_sym16(uint64_t ind); | 9 | static Cube antindex_drud_sym16(uint64_t ind); |
| 11 | static Cube antindex_drudfin_noE_sym16(uint64_t ind); | 10 | static Cube antindex_drudfin_noE_sym16(uint64_t ind); |
| 12 | static Cube antindex_khuge(uint64_t ind); | 11 | static Cube antindex_khuge(uint64_t ind); |
| 12 | static Cube antindex_nxopt31(uint64_t ind); | ||
| 13 | 13 | ||
| 14 | static uint64_t index_coud_sym16(Cube cube); | ||
| 15 | static uint64_t index_cp_sym16(Cube cube); | 14 | static uint64_t index_cp_sym16(Cube cube); |
| 16 | static uint64_t index_eofbepos_sym16(Cube cube); | 15 | static uint64_t index_eofbepos_sym16(Cube cube); |
| 17 | static uint64_t index_drud_sym16(Cube cube); | 16 | static uint64_t index_drud_sym16(Cube cube); |
| 18 | static uint64_t index_drudfin_noE_sym16(Cube cube); | 17 | static uint64_t index_drudfin_noE_sym16(Cube cube); |
| 19 | static uint64_t index_khuge(Cube cube); | 18 | static uint64_t index_khuge(Cube cube); |
| 19 | static uint64_t index_nxopt31(Cube cube); | ||
| 20 | 20 | ||
| 21 | static int transfinder_drud_sym16(uint64_t ind, Trans *ret); | 21 | static int transfinder_drud_sym16(uint64_t ind, Trans *ret); |
| 22 | static int transfinder_drudfin_noE_sym16(uint64_t ind, Trans *ret); | 22 | static int transfinder_drudfin_noE_sym16(uint64_t ind, Trans *ret); |
| 23 | static int transfinder_khuge(uint64_t ind, Trans *ret); | 23 | static int transfinder_khuge(uint64_t ind, Trans *ret); |
| 24 | static int transfinder_nxopt31(uint64_t ind, Trans *ret); | ||
| 24 | 25 | ||
| 25 | static void gensym(SymData *sd); | 26 | static void gensym(SymData *sd); |
| 26 | static bool read_symdata_file(SymData *sd); | 27 | static bool read_symdata_file(SymData *sd); |
| @@ -38,15 +39,6 @@ trans_group_udfix[16] = { | |||
| 38 | }; | 39 | }; |
| 39 | 40 | ||
| 40 | static SymData | 41 | static SymData |
| 41 | sd_coud_16 = { | ||
| 42 | .filename = "sd_coud_16", | ||
| 43 | .coord = &coord_coud, | ||
| 44 | .sym_coord = &coord_coud_sym16, | ||
| 45 | .ntrans = 16, | ||
| 46 | .trans = trans_group_udfix | ||
| 47 | }; | ||
| 48 | |||
| 49 | static SymData | ||
| 50 | sd_cp_16 = { | 42 | sd_cp_16 = { |
| 51 | .filename = "sd_cp_16", | 43 | .filename = "sd_cp_16", |
| 52 | .coord = &coord_cp, | 44 | .coord = &coord_cp, |
| @@ -64,9 +56,8 @@ sd_eofbepos_16 = { | |||
| 64 | .trans = trans_group_udfix | 56 | .trans = trans_group_udfix |
| 65 | }; | 57 | }; |
| 66 | 58 | ||
| 67 | static int nsymdata = 3; | 59 | static int nsymdata = 2; |
| 68 | static SymData * all_sd[] = { | 60 | static SymData * all_sd[] = { |
| 69 | &sd_coud_16, | ||
| 70 | &sd_cp_16, | 61 | &sd_cp_16, |
| 71 | &sd_eofbepos_16, | 62 | &sd_eofbepos_16, |
| 72 | }; | 63 | }; |
| @@ -81,12 +72,6 @@ coord_eofbepos_sym16 = { | |||
| 81 | }; | 72 | }; |
| 82 | 73 | ||
| 83 | Coordinate | 74 | Coordinate |
| 84 | coord_coud_sym16 = { | ||
| 85 | .index = index_coud_sym16, | ||
| 86 | .cube = antindex_coud_sym16, | ||
| 87 | }; | ||
| 88 | |||
| 89 | Coordinate | ||
| 90 | coord_cp_sym16 = { | 75 | coord_cp_sym16 = { |
| 91 | .index = index_cp_sym16, | 76 | .index = index_cp_sym16, |
| 92 | .cube = antindex_cp_sym16, | 77 | .cube = antindex_cp_sym16, |
| @@ -116,13 +101,15 @@ coord_khuge = { | |||
| 116 | .trans = transfinder_khuge, | 101 | .trans = transfinder_khuge, |
| 117 | }; | 102 | }; |
| 118 | 103 | ||
| 119 | /* Functions *****************************************************************/ | 104 | Coordinate |
| 105 | coord_nxopt31 = { | ||
| 106 | .index = index_nxopt31, | ||
| 107 | .cube = antindex_nxopt31, | ||
| 108 | .max = POW3TO7 * BINOM8ON4 * CLASSES_EOFBEPOS_16 , | ||
| 109 | .trans = transfinder_nxopt31, | ||
| 110 | }; | ||
| 120 | 111 | ||
| 121 | static Cube | 112 | /* Functions *****************************************************************/ |
| 122 | antindex_coud_sym16(uint64_t ind) | ||
| 123 | { | ||
| 124 | return sd_coud_16.rep[ind]; | ||
| 125 | } | ||
| 126 | 113 | ||
| 127 | static Cube | 114 | static Cube |
| 128 | antindex_cp_sym16(uint64_t ind) | 115 | antindex_cp_sym16(uint64_t ind) |
| @@ -173,10 +160,16 @@ antindex_khuge(uint64_t ind) | |||
| 173 | return c; | 160 | return c; |
| 174 | } | 161 | } |
| 175 | 162 | ||
| 176 | static uint64_t | 163 | static Cube |
| 177 | index_coud_sym16(Cube cube) | 164 | antindex_nxopt31(uint64_t ind) |
| 178 | { | 165 | { |
| 179 | return sd_coud_16.class[coord_coud.index(cube)]; | 166 | Cube c; |
| 167 | |||
| 168 | c = antindex_eofbepos_sym16(ind/(BINOM8ON4*POW3TO7)); | ||
| 169 | c.cp = coord_cpud_separate.cube((ind/POW3TO7)%BINOM8ON4).cp; | ||
| 170 | c.coud = ind % POW3TO7; | ||
| 171 | |||
| 172 | return c; | ||
| 180 | } | 173 | } |
| 181 | 174 | ||
| 182 | static uint64_t | 175 | static uint64_t |
| @@ -229,6 +222,20 @@ index_khuge(Cube cube) | |||
| 229 | return a * POW3TO7 + c.coud; | 222 | return a * POW3TO7 + c.coud; |
| 230 | } | 223 | } |
| 231 | 224 | ||
| 225 | static uint64_t | ||
| 226 | index_nxopt31(Cube cube) | ||
| 227 | { | ||
| 228 | Trans t; | ||
| 229 | Cube c; | ||
| 230 | uint64_t a; | ||
| 231 | |||
| 232 | t = sd_eofbepos_16.transtorep[coord_eofbepos.index(cube)]; | ||
| 233 | c = apply_trans(t, cube); | ||
| 234 | a = (index_eofbepos_sym16(c)*BINOM8ON4) + coord_cpud_separate.index(c); | ||
| 235 | |||
| 236 | return a * POW3TO7 + c.coud; | ||
| 237 | } | ||
| 238 | |||
| 232 | static int | 239 | static int |
| 233 | transfinder_drud_sym16(uint64_t ind, Trans *ret) | 240 | transfinder_drud_sym16(uint64_t ind, Trans *ret) |
| 234 | { | 241 | { |
| @@ -295,6 +302,28 @@ transfinder_khuge(uint64_t ind, Trans *ret) | |||
| 295 | return naux[trueind]; | 302 | return naux[trueind]; |
| 296 | } | 303 | } |
| 297 | 304 | ||
| 305 | static int | ||
| 306 | transfinder_nxopt31(uint64_t ind, Trans *ret) | ||
| 307 | { | ||
| 308 | uint64_t i, trueind; | ||
| 309 | int j; | ||
| 310 | static bool initialized = false; | ||
| 311 | static int naux[CLASSES_EOFBEPOS_16]; | ||
| 312 | static Trans retaux[CLASSES_EOFBEPOS_16][NTRANS]; | ||
| 313 | |||
| 314 | if (!initialized) { | ||
| 315 | for (i = 0; i < CLASSES_EOFBEPOS_16; i++) | ||
| 316 | naux[i] = selfsims(&sd_eofbepos_16, i, retaux[i]); | ||
| 317 | |||
| 318 | initialized = true; | ||
| 319 | } | ||
| 320 | |||
| 321 | trueind = ind/(BINOM8ON4*POW3TO7); | ||
| 322 | for (j = 0; j < naux[trueind]; j++) | ||
| 323 | ret[j] = retaux[trueind][j]; | ||
| 324 | return naux[trueind]; | ||
| 325 | } | ||
| 326 | |||
| 298 | /* Other functions ***********************************************************/ | 327 | /* Other functions ***********************************************************/ |
| 299 | 328 | ||
| 300 | static void | 329 | static void |
