@Test public void testGetPotentialPairsPerStack() throws Exception { final int[][] data = { { 3, 1, 2 }, { 5, 1, 4 }, { 10, 2, 17 }, { 10, 3, 24 }, { 4, 20, 6 }, { 5, 8, 10 } }; for (final int[] testData : data) { final int numberOfLayers = testData[0]; final int distance = testData[1]; final long expectedResult = testData[2]; final long result = HierarchicalAlignmentClient.getPotentialPairsPerStack(numberOfLayers, distance); Assert.assertEquals("invalid result for " + numberOfLayers + " layers and distance " + distance, expectedResult, result); } }
static long getPotentialPairsPerStack(final int numberOfLayers, final int zNeighborDistance) { final long potentialPairsPerStack; if (zNeighborDistance >= numberOfLayers) { potentialPairsPerStack = getTriangularNumber(numberOfLayers - 1); } else { potentialPairsPerStack = (numberOfLayers * zNeighborDistance) - getTriangularNumber(zNeighborDistance); } return potentialPairsPerStack; }
HierarchicalAlignmentClient implements Serializable { static long getPotentialPairsPerStack(final int numberOfLayers, final int zNeighborDistance) { final long potentialPairsPerStack; if (zNeighborDistance >= numberOfLayers) { potentialPairsPerStack = getTriangularNumber(numberOfLayers - 1); } else { potentialPairsPerStack = (numberOfLayers * zNeighborDistance) - getTriangularNumber(zNeighborDistance); } return potentialPairsPerStack; } }
HierarchicalAlignmentClient implements Serializable { static long getPotentialPairsPerStack(final int numberOfLayers, final int zNeighborDistance) { final long potentialPairsPerStack; if (zNeighborDistance >= numberOfLayers) { potentialPairsPerStack = getTriangularNumber(numberOfLayers - 1); } else { potentialPairsPerStack = (numberOfLayers * zNeighborDistance) - getTriangularNumber(zNeighborDistance); } return potentialPairsPerStack; } HierarchicalAlignmentClient(final Parameters parameters,
                                final SparkConf sparkConf); }
HierarchicalAlignmentClient implements Serializable { static long getPotentialPairsPerStack(final int numberOfLayers, final int zNeighborDistance) { final long potentialPairsPerStack; if (zNeighborDistance >= numberOfLayers) { potentialPairsPerStack = getTriangularNumber(numberOfLayers - 1); } else { potentialPairsPerStack = (numberOfLayers * zNeighborDistance) - getTriangularNumber(zNeighborDistance); } return potentialPairsPerStack; } HierarchicalAlignmentClient(final Parameters parameters,
                                final SparkConf sparkConf); static void main(final String[] args); void run(); }
HierarchicalAlignmentClient implements Serializable { static long getPotentialPairsPerStack(final int numberOfLayers, final int zNeighborDistance) { final long potentialPairsPerStack; if (zNeighborDistance >= numberOfLayers) { potentialPairsPerStack = getTriangularNumber(numberOfLayers - 1); } else { potentialPairsPerStack = (numberOfLayers * zNeighborDistance) - getTriangularNumber(zNeighborDistance); } return potentialPairsPerStack; } HierarchicalAlignmentClient(final Parameters parameters,
                                final SparkConf sparkConf); static void main(final String[] args); void run();  }