public void testScale_indexes_varargs_computeInPlace_empty() { Quantiles.ScaleAndIndexes intermediate = Quantiles.scale(10).indexes(1, 3, 5); try { intermediate.computeInPlace(new double[] {}); fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException expected) { } } }
@AndroidIncompatible // presumably slow public void testLessThanBranchFree() { for (int x : ALL_INTEGER_CANDIDATES) { for (int y : ALL_INTEGER_CANDIDATES) { if (LongMath.fitsInInt((long) x - y)) { int expected = (x < y) ? 1 : 0; int actual = IntMath.lessThanBranchFree(x, y); assertEquals(expected, actual); } } } }
public void testScale_index_computeInPlace_empty() { Quantiles.ScaleAndIndex intermediate = Quantiles.scale(10).index(3); try { intermediate.computeInPlace(new double[] {}); fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException expected) { } }
public void testMappingWithSlope_regular() { double x1 = 1.2; double y1 = 3.4; double xDelta = -5.6; double slope = -7.8; LinearTransformation transformation = LinearTransformation.mapping(x1, y1).withSlope(slope); assertDiagonalLinearTransformation(transformation, x1, y1, xDelta, xDelta * slope); }
public void testMappingWithSlope_horizontal() { double x1 = 1.2; double y = 5.6; LinearTransformation transformation = LinearTransformation.mapping(x1, y).withSlope(0.0); assertHorizontalLinearTransformation(transformation, y); }
public void testMappingAnd_vertical() { double x = 1.2; double y1 = 3.4; double yDelta = 5.6; LinearTransformation transformation = LinearTransformation.mapping(x, y1).and(x, y1 + yDelta); assertVerticalLinearTransformation(transformation, x); }
public void testMappingAnd_regular() { double x1 = 1.2; double y1 = 3.4; double xDelta = 5.6; double yDelta = 7.8; LinearTransformation transformation = LinearTransformation.mapping(x1, y1).and(x1 + xDelta, y1 + yDelta); assertDiagonalLinearTransformation(transformation, x1, y1, xDelta, yDelta); }