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

Generated with cgit - Back to sebastiano.tronto.net