internal long selfSymmetry() { CubieCube c = new CubieCube(this); CubieCube d = new CubieCube(); long sym = 0L; for (int i = 0; i < 48; i++) { CornConjugate(c, SymInv[i % 16], d); if (d.equalsCorn(this)) { EdgeConjugate(c, SymInv[i % 16], d); if (d.equalsEdge(this)) { sym |= 1L << i; } } if (i % 16 == 15) { c.URFConjugate(); } } c.invCubieCube(); for (int i = 0; i < 48; i++) { CornConjugate(c, SymInv[i % 16], d); if (d.equalsCorn(this)) { EdgeConjugate(c, SymInv[i % 16], d); if (d.equalsEdge(this)) { sym |= 1L << 48; break; } } if (i % 16 == 15) { c.URFConjugate(); } } return(sym); }
internal static void initSym() { CubieCube c = new CubieCube(); CubieCube d = new CubieCube(); CubieCube t; CubieCube f2 = new CubieCube(28783, 0, 259268407, 0); CubieCube u4 = new CubieCube(15138, 0, 119765538, 7); CubieCube lr2 = new CubieCube(5167, 0, 83473207, 0); for (int i = 0; i < 8; i++) { lr2.ca[i] |= 3 << 3; } for (int i = 0; i < 16; i++) { CubeSym[i] = new CubieCube(c); CornMult(c, u4, d); EdgeMult(c, u4, d); t = d; d = c; c = t; if (i % 4 == 3) { CornMult(c, lr2, d); EdgeMult(c, lr2, d); t = d; d = c; c = t; } if (i % 8 == 7) { CornMult(c, f2, d); EdgeMult(c, f2, d); t = d; d = c; c = t; } } for (int i = 0; i < 16; i++) { for (int j = 0; j < 16; j++) { CornMult(CubeSym[i], CubeSym[j], c); for (int k = 0; k < 16; k++) { if (CubeSym[k].equalsCorn(c)) { SymMult[i, j] = k; if (k == 0) { SymInv[i] = j; } break; } } } } for (int j = 0; j < 18; j++) { for (int s = 0; s < 16; s++) { CornConjugate(moveCube[j], SymInv[s], c); for (int m = 0; m < 18; m++) { if (c.equalsCorn(moveCube[m])) { SymMove[s, j] = m; break; } } } } for (int s = 0; s < 16; s++) { for (int j = 0; j < 10; j++) { SymMoveUD[s, j] = Util.std2ud[SymMove[s, Util.ud2std[j]]]; } for (int j = 0; j < 16; j++) { SymMultInv[j, s] = SymMult[j, SymInv[s]]; } } for (int s = 0; s < 8; s++) { for (int j = 0; j < 8; j++) { Sym8Mult[s << 3 | j] = SymMult[j << 1, s << 1] >> 1; Sym8MultInv[j << 3 | s] = SymMult[j << 1, SymInv[s << 1]] >> 1; } for (int j = 0; j < 18; j++) { Sym8Move[j << 3 | s] = SymMove[s << 1, j]; } } for (int i = 0; i < 18; i++) { moveCubeSym[i] = moveCube[i].selfSymmetry(); } for (int i = 0; i < 18; i++) { int j = i; for (int s = 0; s < 48; s++) { if (SymMove[s % 16, j] < i) { firstMoveSym[s] |= 1 << i; } if (s % 16 == 15) { j = urfMove[2, j]; } } } }