MCPcopy Create free account
hub / github.com/MeigenChou/DCTimer-Android / initSearch

Method initSearch

app/src/main/java/cs/min2phase/Search.java:192–230  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

190 }
191
192 private void initSearch() {
193 conjMask = (TRY_INVERSE ? 0 : 0x38) | (TRY_THREE_AXES ? 0 : 0x36);
194 CubieCube pc = new CubieCube();
195
196 for (int i = 0; i < 6; i++) {
197
198 for (int j = 0; j < PRE_IDX_MAX; j++) {
199 CubieCube.CornMult(CubieCube.preList[j], cc, pc);
200 CubieCube.EdgeMult(CubieCube.preList[j], cc, pc);
201 twist[i][j] = pc.getTwistSym();
202 flip[i][j] = pc.getFlipSym();
203 slice[i][j] = pc.getUDSlice();
204 corn0[i][j] = pc.getCPermSym();
205 ud8e0[i][j] = pc.getU4Comb() << 16 | pc.getD4Comb();
206 prun[i][j] = -1;
207 }
208
209 cc.URFConjugate();
210 if (i % 3 == 2) {
211 cc.invCubieCube();
212 }
213 }
214
215 for (int i = 0; i < 6; i++) {
216 for (int j = 0; j < i; j++) { //If S_i^-1 * C * S_i == C, It's unnecessary to compute it again.
217 if (twist[i][0] == twist[j][0] && flip[i][0] == flip[j][0] && slice[i][0] == slice[j][0]
218 && corn0[i][0] == corn0[j][0] && ud8e0[i][0] == ud8e0[j][0]) {
219 conjMask |= 1 << i;
220 break;
221 }
222 }
223 if ((conjMask & (1 << i)) != 0) {
224 continue;
225 }
226 for (int j = 0; j < PRE_IDX_MAX; j++) {
227 fillprun(i, j);
228 }
229 }
230 }
231
232 public synchronized String next(long probeMax, long probeMin, int verbose) {
233 this.probe = 0;

Callers 1

solutionMethod · 0.95

Calls 11

CornMultMethod · 0.95
EdgeMultMethod · 0.95
getTwistSymMethod · 0.95
getFlipSymMethod · 0.95
getUDSliceMethod · 0.95
getCPermSymMethod · 0.95
getU4CombMethod · 0.95
getD4CombMethod · 0.95
fillprunMethod · 0.95
URFConjugateMethod · 0.80
invCubieCubeMethod · 0.80

Tested by

no test coverage detected