public Evaluator() {
    Value = new int[Pattern.LAST][POW_3_8];
    PatternNum = new int[Pattern.LAST][POW_3_8];
    PatternSum = new int[Pattern.LAST][POW_3_8];
    MirrorLine = new int[POW_3_8];
    MirrorCorner = new int[POW_3_8];

    for (int i = 0; i < POW_3_8; i++) {
      int mirror_in = i;
      int mirror_out = 0;
      int coeff = POW_3_7;
      for (int j=0; j < 8; j++) {
        mirror_out += mirror_in % 3 * coeff;
        mirror_in /= 3;
        coeff /= 3;
      }
      if (mirror_out < i) {
        MirrorLine[i] = mirror_out;
      } else {
        MirrorLine[i] = i;
      }
    }

    int mirror_corner_coeff[] = { POW_3_2, POW_3_5, POW_3_0, POW_3_3, POW_3_6, POW_3_1, POW_3_4, POW_3_7 };
    for (int i = 0; i < POW_3_8; i++) {
      int mirror_in = i;
      int mirror_out = 0;
      for (int j=0; j < 8; j++) {
        mirror_out += mirror_in % 3 * mirror_corner_coeff[j];
        mirror_in /= 3;
      }
      if (mirror_out < i) {
        MirrorCorner[i] = mirror_out;
      } else {
        MirrorCorner[i] = i;
      }
    }
  }