Esempio n. 1
0
  private static void initMove() {

    CenterCubies cube1 = new CenterCubies();
    CenterCubies cube2 = new CenterCubies();
    Center3 c = new Center3();
    for (int u = 0; u < N_COORD; ++u) {
      c.raw_coord = sym2raw[u];
      c.unpack(cube1);
      for (int m = 0; m < N_MOVES; ++m) {
        cube1.move(Moves.stage2moves[m], cube2);
        c.pack(cube2);
        move[u][m] = raw2sym[c.raw_coord];
      }
    }
  }
Esempio n. 2
0
  private static void initSym2Raw() {
    int repIdx = 0;
    CenterCubies cube1 = new CenterCubies();
    CenterCubies cube2 = new CenterCubies();
    Center3 c = new Center3();

    byte[] isRepTable = new byte[(N_RAW_COORD >> 3) + 1];
    hasSym = new int[N_COORD];
    for (int u = 0; u < N_RAW_COORD; ++u) {
      if (Util.get1bit(isRepTable, u)) continue;
      raw2sym[u] = repIdx << SYM_SHIFT;
      c.raw_coord = u;
      c.unpack(cube1);
      for (int s = 1; s < N_SYM; ++s) {
        cube1.rightMult(Symmetry.invSymIdx[s], cube2);
        c.pack(cube2);
        Util.set1bit(isRepTable, c.raw_coord);
        raw2sym[c.raw_coord] = (repIdx << SYM_SHIFT) + Symmetry.invSymIdx[s];
        if (c.raw_coord == u) hasSym[repIdx] |= (1 << s);
      }
      sym2raw[repIdx++] = u;
    }
  }