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