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); }
private void initSearch() { conjMask = (TRY_INVERSE ? 0 : 0x38) | (TRY_THREE_AXES ? 0 : 0x36); CubieCube pc = new CubieCube(); selfSym = cc.selfSymmetry(); if (selfSym >> 48 != 0) { conjMask |= 0x38; } if ((selfSym >> 16 & 0xffff) != 0) { conjMask |= 0x12; } if ((selfSym >> 32 & 0xffff) != 0) { conjMask |= 0x24; } preIdxMax = conjMask > 7 ? 1 : PRE_IDX_MAX; for (int i = 0; i < 6; i++) { node0[i, 0].set(cc); corn0[i, 0] = cc.getCPermSym(); ud8e0[i, 0] = cc.getU4Comb() << 16 | cc.getD4Comb(); if ((conjMask & 1 << i) == 0) { for (int j = 1; j < preIdxMax; j++) { CubieCube.CornMult(CubieCube.moveCube[CubieCube.preMove[j]], cc, pc); CubieCube.EdgeMult(CubieCube.moveCube[CubieCube.preMove[j]], cc, pc); node0[i, j].set(pc); corn0[i, j] = pc.getCPermSym(); ud8e0[i, j] = pc.getU4Comb() << 16 | pc.getD4Comb(); } } cc.URFConjugate(); if (i % 3 == 2) { cc.invCubieCube(); } } selfSym = selfSym & 0xffffffffffffL; }