@Test public void testCreateSymmetricIntArraySymmetryExpander4() throws Exception { RectSize BS = new RectSize(8); int[] tuple = { toMarginPos(BS, 1, 1), toMarginPos(BS, 2, 2) }; int[][] expanded = SymmetryUtils.createSymmetric(tuple, new RotationMirrorSymmetryExpander(BS)).toArray(new int[0][]); int[][] expected = { { toMarginPos(BS, 1, 1), toMarginPos(BS, 2, 2) }, { toMarginPos(BS, 1, 6), toMarginPos(BS, 2, 5) }, { toMarginPos(BS, 6, 1), toMarginPos(BS, 5, 2) }, { toMarginPos(BS, 6, 6), toMarginPos(BS, 5, 5) }, }; Assert.assertArrayEquals(expanded[0], expected[0]); sortSomehow(expanded); sortSomehow(expected); Assert.assertEquals(expected.length, expanded.length); for (int i = 0; i < expected.length; ++i) { Assert.assertArrayEquals(expected[i], expanded[i]); } }
public static List<NTuple> createSymmetric(NTuple template, SymmetryExpander expander) { List<int[]> symmetric = SymmetryUtils.createSymmetric(template.getLocations(), expander); List<NTuple> tuples = new ArrayList<>(symmetric.size()); for (int[] locations : symmetric) { tuples.add(NTuple.newWithSharedWeights(template, locations)); } assert tuples.get(0).equals(template); return tuples; }
NTupleUtils { public static List<NTuple> createSymmetric(NTuple template, SymmetryExpander expander) { List<int[]> symmetric = SymmetryUtils.createSymmetric(template.getLocations(), expander); List<NTuple> tuples = new ArrayList<>(symmetric.size()); for (int[] locations : symmetric) { tuples.add(NTuple.newWithSharedWeights(template, locations)); } assert tuples.get(0).equals(template); return tuples; } }
NTupleUtils { public static List<NTuple> createSymmetric(NTuple template, SymmetryExpander expander) { List<int[]> symmetric = SymmetryUtils.createSymmetric(template.getLocations(), expander); List<NTuple> tuples = new ArrayList<>(symmetric.size()); for (int[] locations : symmetric) { tuples.add(NTuple.newWithSharedWeights(template, locations)); } assert tuples.get(0).equals(template); return tuples; }  }
NTupleUtils { public static List<NTuple> createSymmetric(NTuple template, SymmetryExpander expander) { List<int[]> symmetric = SymmetryUtils.createSymmetric(template.getLocations(), expander); List<NTuple> tuples = new ArrayList<>(symmetric.size()); for (int[] locations : symmetric) { tuples.add(NTuple.newWithSharedWeights(template, locations)); } assert tuples.get(0).equals(template); return tuples; }  static List<NTuple> createSymmetric(NTuple template, SymmetryExpander expander); static List<RelativeNTuple> createSymmetric(RelativeNTuple template, SymmetryExpander expander); static List<BigNTuple> createSymmetric(BigNTuple template, SymmetryExpander expander); static IntArrayList[] getTuplesForPositions(NTuples tuples, int numBoardPositions); }
NTupleUtils { public static List<NTuple> createSymmetric(NTuple template, SymmetryExpander expander) { List<int[]> symmetric = SymmetryUtils.createSymmetric(template.getLocations(), expander); List<NTuple> tuples = new ArrayList<>(symmetric.size()); for (int[] locations : symmetric) { tuples.add(NTuple.newWithSharedWeights(template, locations)); } assert tuples.get(0).equals(template); return tuples; }  static List<NTuple> createSymmetric(NTuple template, SymmetryExpander expander); static List<RelativeNTuple> createSymmetric(RelativeNTuple template, SymmetryExpander expander); static List<BigNTuple> createSymmetric(BigNTuple template, SymmetryExpander expander); static IntArrayList[] getTuplesForPositions(NTuples tuples, int numBoardPositions);  }