diff options
Diffstat (limited to 'src/coord.h')
| -rw-r--r-- | src/coord.h | 259 |
1 files changed, 0 insertions, 259 deletions
diff --git a/src/coord.h b/src/coord.h deleted file mode 100644 index 4cd7e47..0000000 --- a/src/coord.h +++ /dev/null | |||
| @@ -1,259 +0,0 @@ | |||
| 1 | #ifndef COORD_H | ||
| 2 | #define COORD_H | ||
| 3 | |||
| 4 | #include "trans.h" | ||
| 5 | |||
| 6 | void gen_coord(Coordinate *coord); | ||
| 7 | uint64_t index_coord(Coordinate *coord, Cube *cube, | ||
| 8 | Trans *offtrans); | ||
| 9 | uint64_t indexers_getind(Indexer **is, Cube *c); | ||
| 10 | void indexers_makecube(Indexer **is, uint64_t ind, Cube *c); | ||
| 11 | uint64_t move_coord(Coordinate *coord, Move m, | ||
| 12 | uint64_t ind, Trans *offtrans); | ||
| 13 | uint64_t trans_coord(Coordinate *coord, Trans t, uint64_t ind); | ||
| 14 | |||
| 15 | /* Base coordinates and their index functions ********************************/ | ||
| 16 | |||
| 17 | #ifndef COORD_C | ||
| 18 | |||
| 19 | extern Coordinate coord_eofb; | ||
| 20 | extern Coordinate coord_coud; | ||
| 21 | extern Coordinate coord_cp; | ||
| 22 | extern Coordinate coord_cpudsep; | ||
| 23 | extern Coordinate coord_epos; | ||
| 24 | extern Coordinate coord_epe; | ||
| 25 | extern Coordinate coord_eposepe; | ||
| 26 | extern Coordinate coord_epud; | ||
| 27 | extern Coordinate coord_eofbepos; | ||
| 28 | extern Coordinate coord_coud_cpudsep; | ||
| 29 | extern Coordinate coord_eofbepos_sym16; | ||
| 30 | extern Coordinate coord_cp_sym16; | ||
| 31 | extern Coordinate coord_corners_sym16; | ||
| 32 | extern Coordinate coord_drud_sym16; | ||
| 33 | extern Coordinate coord_drudfin_noE_sym16; | ||
| 34 | extern Coordinate coord_nxopt31; | ||
| 35 | |||
| 36 | extern Coordinate *all_coordinates[]; | ||
| 37 | |||
| 38 | #else | ||
| 39 | |||
| 40 | /* Indexers ******************************************************************/ | ||
| 41 | |||
| 42 | uint64_t index_eofb(Cube *cube); | ||
| 43 | void invindex_eofb(uint64_t ind, Cube *ret); | ||
| 44 | Indexer | ||
| 45 | i_eofb = { | ||
| 46 | .n = POW2TO11, | ||
| 47 | .index = index_eofb, | ||
| 48 | .to_cube = invindex_eofb, | ||
| 49 | }; | ||
| 50 | |||
| 51 | uint64_t index_coud(Cube *cube); | ||
| 52 | void invindex_coud(uint64_t ind, Cube *ret); | ||
| 53 | Indexer | ||
| 54 | i_coud = { | ||
| 55 | .n = POW3TO7, | ||
| 56 | .index = index_coud, | ||
| 57 | .to_cube = invindex_coud, | ||
| 58 | }; | ||
| 59 | |||
| 60 | uint64_t index_cp(Cube *cube); | ||
| 61 | void invindex_cp(uint64_t ind, Cube *ret); | ||
| 62 | Indexer | ||
| 63 | i_cp = { | ||
| 64 | .n = FACTORIAL8, | ||
| 65 | .index = index_cp, | ||
| 66 | .to_cube = invindex_cp, | ||
| 67 | }; | ||
| 68 | |||
| 69 | uint64_t index_cpudsep(Cube *cube); | ||
| 70 | void invindex_cpudsep(uint64_t ind, Cube *ret); | ||
| 71 | Indexer | ||
| 72 | i_cpudsep = { | ||
| 73 | .n = BINOM8ON4, | ||
| 74 | .index = index_cpudsep, | ||
| 75 | .to_cube = invindex_cpudsep, | ||
| 76 | }; | ||
| 77 | |||
| 78 | uint64_t index_epos(Cube *cube); | ||
| 79 | void invindex_epos(uint64_t ind, Cube *ret); | ||
| 80 | Indexer | ||
| 81 | i_epos = { | ||
| 82 | .n = BINOM12ON4, | ||
| 83 | .index = index_epos, | ||
| 84 | .to_cube = invindex_epos, | ||
| 85 | }; | ||
| 86 | |||
| 87 | uint64_t index_epe(Cube *cube); | ||
| 88 | void invindex_epe(uint64_t ind, Cube *ret); | ||
| 89 | Indexer | ||
| 90 | i_epe = { | ||
| 91 | .n = FACTORIAL4, | ||
| 92 | .index = index_epe, | ||
| 93 | .to_cube = invindex_epe, | ||
| 94 | }; | ||
| 95 | |||
| 96 | uint64_t index_eposepe(Cube *cube); | ||
| 97 | void invindex_eposepe(uint64_t ind, Cube *ret); | ||
| 98 | Indexer | ||
| 99 | i_eposepe = { | ||
| 100 | .n = BINOM12ON4 * FACTORIAL4, | ||
| 101 | .index = index_eposepe, | ||
| 102 | .to_cube = invindex_eposepe, | ||
| 103 | }; | ||
| 104 | |||
| 105 | uint64_t index_epud(Cube *cube); | ||
| 106 | void invindex_epud(uint64_t ind, Cube *ret); | ||
| 107 | Indexer | ||
| 108 | i_epud = { | ||
| 109 | .n = FACTORIAL8, | ||
| 110 | .index = index_epud, | ||
| 111 | .to_cube = invindex_epud, | ||
| 112 | }; | ||
| 113 | |||
| 114 | /* Composite coordinates *****************************************************/ | ||
| 115 | |||
| 116 | Coordinate | ||
| 117 | coord_eofb = { | ||
| 118 | .name = "eofb", | ||
| 119 | .type = COMP_COORD, | ||
| 120 | .i = {&i_eofb, NULL}, | ||
| 121 | }; | ||
| 122 | |||
| 123 | Coordinate | ||
| 124 | coord_coud = { | ||
| 125 | .name = "coud", | ||
| 126 | .type = COMP_COORD, | ||
| 127 | .i = {&i_coud, NULL}, | ||
| 128 | }; | ||
| 129 | |||
| 130 | Coordinate | ||
| 131 | coord_cp = { | ||
| 132 | .name = "cp", | ||
| 133 | .type = COMP_COORD, | ||
| 134 | .i = {&i_cp, NULL}, | ||
| 135 | }; | ||
| 136 | |||
| 137 | Coordinate | ||
| 138 | coord_cpudsep = { | ||
| 139 | .name = "cpudsep", | ||
| 140 | .type = COMP_COORD, | ||
| 141 | .i = {&i_cpudsep, NULL}, | ||
| 142 | }; | ||
| 143 | |||
| 144 | Coordinate | ||
| 145 | coord_epos = { | ||
| 146 | .name = "epos", | ||
| 147 | .type = COMP_COORD, | ||
| 148 | .i = {&i_epos, NULL}, | ||
| 149 | }; | ||
| 150 | |||
| 151 | Coordinate | ||
| 152 | coord_epe = { | ||
| 153 | .name = "epe", | ||
| 154 | .type = COMP_COORD, | ||
| 155 | .i = {&i_epe, NULL}, | ||
| 156 | }; | ||
| 157 | |||
| 158 | Coordinate | ||
| 159 | coord_eposepe = { /* Has to be done by hand, hard compose epos + epe */ | ||
| 160 | .name = "eposepe", | ||
| 161 | .type = COMP_COORD, | ||
| 162 | .i = {&i_eposepe, NULL}, | ||
| 163 | }; | ||
| 164 | |||
| 165 | Coordinate | ||
| 166 | coord_epud = { | ||
| 167 | .name = "epud", | ||
| 168 | .type = COMP_COORD, | ||
| 169 | .i = {&i_epud, NULL}, | ||
| 170 | }; | ||
| 171 | |||
| 172 | Coordinate | ||
| 173 | coord_eofbepos = { | ||
| 174 | .name = "eofbepos", | ||
| 175 | .type = COMP_COORD, | ||
| 176 | .i = {&i_epos, &i_eofb, NULL}, | ||
| 177 | }; | ||
| 178 | |||
| 179 | Coordinate | ||
| 180 | coord_coud_cpudsep = { | ||
| 181 | .name = "coud_cpudsep", | ||
| 182 | .type = COMP_COORD, | ||
| 183 | .i = {&i_coud, &i_cpudsep, NULL}, | ||
| 184 | }; | ||
| 185 | |||
| 186 | /* Symcoordinates ************************************************************/ | ||
| 187 | |||
| 188 | Coordinate | ||
| 189 | coord_eofbepos_sym16 = { | ||
| 190 | .name = "eofbepos_sym16", | ||
| 191 | .type = SYM_COORD, | ||
| 192 | .base = {&coord_eofbepos, NULL}, | ||
| 193 | .tgrp = &tgrp_udfix, | ||
| 194 | }; | ||
| 195 | |||
| 196 | Coordinate | ||
| 197 | coord_cp_sym16 = { | ||
| 198 | .name = "cp_sym16", | ||
| 199 | .type = SYM_COORD, | ||
| 200 | .base = {&coord_cp, NULL}, | ||
| 201 | .tgrp = &tgrp_udfix, | ||
| 202 | }; | ||
| 203 | |||
| 204 | /* "Symcomp" coordinates *****************************************************/ | ||
| 205 | |||
| 206 | Coordinate | ||
| 207 | coord_corners_sym16 = { | ||
| 208 | .name = "corners_sym16", | ||
| 209 | .type = SYMCOMP_COORD, | ||
| 210 | .base = {&coord_cp_sym16, &coord_coud}, | ||
| 211 | }; | ||
| 212 | |||
| 213 | Coordinate | ||
| 214 | coord_drud_sym16 = { | ||
| 215 | .name = "drud_sym16", | ||
| 216 | .type = SYMCOMP_COORD, | ||
| 217 | .base = {&coord_eofbepos_sym16, &coord_coud}, | ||
| 218 | }; | ||
| 219 | |||
| 220 | Coordinate | ||
| 221 | coord_drudfin_noE_sym16 = { | ||
| 222 | .name = "drudfin_noE_sym16", | ||
| 223 | .type = SYMCOMP_COORD, | ||
| 224 | .base = {&coord_cp_sym16, &coord_epud}, | ||
| 225 | }; | ||
| 226 | |||
| 227 | Coordinate | ||
| 228 | coord_nxopt31 = { | ||
| 229 | .name = "nxopt31", | ||
| 230 | .type = SYMCOMP_COORD, | ||
| 231 | .base = {&coord_eofbepos_sym16, &coord_coud_cpudsep}, | ||
| 232 | }; | ||
| 233 | |||
| 234 | /* All coordinates ***********************************************************/ | ||
| 235 | |||
| 236 | Coordinate *all_coordinates[] = { | ||
| 237 | &coord_eofb, | ||
| 238 | &coord_coud, | ||
| 239 | &coord_cp, | ||
| 240 | &coord_cpudsep, | ||
| 241 | &coord_epos, | ||
| 242 | &coord_epe, | ||
| 243 | &coord_eposepe, | ||
| 244 | &coord_epud, | ||
| 245 | &coord_eofbepos, | ||
| 246 | &coord_coud_cpudsep, | ||
| 247 | &coord_eofbepos_sym16, | ||
| 248 | &coord_cp_sym16, | ||
| 249 | &coord_corners_sym16, | ||
| 250 | &coord_drud_sym16, | ||
| 251 | &coord_drudfin_noE_sym16, | ||
| 252 | &coord_nxopt31, | ||
| 253 | NULL | ||
| 254 | }; | ||
| 255 | |||
| 256 | #endif | ||
| 257 | |||
| 258 | #endif | ||
| 259 | |||
