/** this = S_urf^-1 * this * S_urf. */ void URFConjugate() { if (temps == null) { temps = new CubieCube(); } CornMult(urf2, this, temps); CornMult(temps, urf1, this); EdgeMult(urf2, this, temps); EdgeMult(temps, urf1, this); }
static void initMove() { moveCube[0] = new CubieCube(15120, 0, 119750400, 0); moveCube[3] = new CubieCube(21021, 1494, 323403417, 0); moveCube[6] = new CubieCube(8064, 1236, 29441808, 550); moveCube[9] = new CubieCube(9, 0, 5880, 0); moveCube[12] = new CubieCube(1230, 412, 2949660, 0); moveCube[15] = new CubieCube(224, 137, 328552, 137); for (int a = 0; a < 18; a += 3) { for (int p = 0; p < 2; p++) { moveCube[a + p + 1] = new CubieCube(); EdgeMult(moveCube[a + p], moveCube[a], moveCube[a + p + 1]); CornMult(moveCube[a + p], moveCube[a], moveCube[a + p + 1]); } } }
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); lr2.co = new byte[] {3, 3, 3, 3, 3, 3, 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].cp[0] == c.cp[0] && CubeSym[k].cp[1] == c.cp[1] && CubeSym[k].cp[2] == c.cp[2]) { 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); CONTINUE: for (int m = 0; m < 18; m++) { for (int i = 0; i < 8; i += 2) { if (c.cp[i] != moveCube[m].cp[i]) { continue CONTINUE; } } SymMove[s][j] = m; break; } } } for (int j = 0; j < 10; j++) { for (int s = 0; s < 16; s++) { SymMoveUD[s][j] = Util.std2ud[SymMove[s][Util.ud2std[j]]]; } } for (int j = 0; j < 8; j++) { for (int s = 0; s < 8; s++) { Sym8Mult[j][s] = SymMult[j << 1][s << 1] >> 1; Sym8MultInv[j][s] = SymMult[j << 1][SymInv[s << 1]] >> 1; } } for (int j = 0; j < 18; j++) { for (int s = 0; s < 8; s++) { Sym8Move[s][j] = SymMove[s << 1][j]; } } }