@Test public void testRemovingDuplicates2Test() throws Exception { BoardPosList[] positionsList = { new BoardPosList("1"), new BoardPosList("001|010|100"), new BoardPosList( "01|10") }; List<List<int[]>> ntuples = new NTuplesLocationsGeneralSystematicSupplier( positionsList, new RectSize(4, 5), new IdentitySymmetryExpander(), true) .get(); Assert.assertEquals(6 + 2 + 2, ntuples.stream().mapToInt(List::size).sum()); }
@Override public List<List<int[]>> get() { NTuplesLocationsBuilder builder = new NTuplesLocationsBuilder(expander, removeSubtuples); for (BoardPosList positions : positionsList) for (int r = 0; r < boardSize.rows(); ++r) for (int c = 0; c < boardSize.columns(); ++c) { BoardPosList nextPositions = positions.getAligned().getShifted(r, c); if (nextPositions.fitOnBoard(boardSize)) { builder.addLocations(nextPositions.toLocations(boardSize)); } } return builder.build(); }
NTuplesLocationsGeneralSystematicSupplier implements Supplier<List<List<int[]>>> { @Override public List<List<int[]>> get() { NTuplesLocationsBuilder builder = new NTuplesLocationsBuilder(expander, removeSubtuples); for (BoardPosList positions : positionsList) for (int r = 0; r < boardSize.rows(); ++r) for (int c = 0; c < boardSize.columns(); ++c) { BoardPosList nextPositions = positions.getAligned().getShifted(r, c); if (nextPositions.fitOnBoard(boardSize)) { builder.addLocations(nextPositions.toLocations(boardSize)); } } return builder.build(); } }
NTuplesLocationsGeneralSystematicSupplier implements Supplier<List<List<int[]>>> { @Override public List<List<int[]>> get() { NTuplesLocationsBuilder builder = new NTuplesLocationsBuilder(expander, removeSubtuples); for (BoardPosList positions : positionsList) for (int r = 0; r < boardSize.rows(); ++r) for (int c = 0; c < boardSize.columns(); ++c) { BoardPosList nextPositions = positions.getAligned().getShifted(r, c); if (nextPositions.fitOnBoard(boardSize)) { builder.addLocations(nextPositions.toLocations(boardSize)); } } return builder.build(); } NTuplesLocationsGeneralSystematicSupplier(String patterns, RectSize boardSize,
			SymmetryExpander symmetryExpander, boolean removeSubtuples);   NTuplesLocationsGeneralSystematicSupplier(BoardPosList[] positionsList, RectSize boardSize,
			SymmetryExpander expander, boolean removeSubtuples);   NTuplesLocationsGeneralSystematicSupplier(BoardPosList positions, RectSize boardSize, SymmetryExpander expander,
			boolean removeSubtuples); private  NTuplesLocationsGeneralSystematicSupplier(String[] shapes, RectSize boardSize,
			SymmetryExpander symmetryExpander, boolean removeSubtuples); }
NTuplesLocationsGeneralSystematicSupplier implements Supplier<List<List<int[]>>> { @Override public List<List<int[]>> get() { NTuplesLocationsBuilder builder = new NTuplesLocationsBuilder(expander, removeSubtuples); for (BoardPosList positions : positionsList) for (int r = 0; r < boardSize.rows(); ++r) for (int c = 0; c < boardSize.columns(); ++c) { BoardPosList nextPositions = positions.getAligned().getShifted(r, c); if (nextPositions.fitOnBoard(boardSize)) { builder.addLocations(nextPositions.toLocations(boardSize)); } } return builder.build(); } NTuplesLocationsGeneralSystematicSupplier(String patterns, RectSize boardSize,
			SymmetryExpander symmetryExpander, boolean removeSubtuples);   NTuplesLocationsGeneralSystematicSupplier(BoardPosList[] positionsList, RectSize boardSize,
			SymmetryExpander expander, boolean removeSubtuples);   NTuplesLocationsGeneralSystematicSupplier(BoardPosList positions, RectSize boardSize, SymmetryExpander expander,
			boolean removeSubtuples); private  NTuplesLocationsGeneralSystematicSupplier(String[] shapes, RectSize boardSize,
			SymmetryExpander symmetryExpander, boolean removeSubtuples); @Override List<List<int[]>> get(); @Override String toString(); }
NTuplesLocationsGeneralSystematicSupplier implements Supplier<List<List<int[]>>> { @Override public List<List<int[]>> get() { NTuplesLocationsBuilder builder = new NTuplesLocationsBuilder(expander, removeSubtuples); for (BoardPosList positions : positionsList) for (int r = 0; r < boardSize.rows(); ++r) for (int c = 0; c < boardSize.columns(); ++c) { BoardPosList nextPositions = positions.getAligned().getShifted(r, c); if (nextPositions.fitOnBoard(boardSize)) { builder.addLocations(nextPositions.toLocations(boardSize)); } } return builder.build(); } NTuplesLocationsGeneralSystematicSupplier(String patterns, RectSize boardSize,
			SymmetryExpander symmetryExpander, boolean removeSubtuples);   NTuplesLocationsGeneralSystematicSupplier(BoardPosList[] positionsList, RectSize boardSize,
			SymmetryExpander expander, boolean removeSubtuples);   NTuplesLocationsGeneralSystematicSupplier(BoardPosList positions, RectSize boardSize, SymmetryExpander expander,
			boolean removeSubtuples); private  NTuplesLocationsGeneralSystematicSupplier(String[] shapes, RectSize boardSize,
			SymmetryExpander symmetryExpander, boolean removeSubtuples); @Override List<List<int[]>> get(); @Override String toString();  }