Formatting (unit test).
Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/cd64fa33 Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/cd64fa33 Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/cd64fa33 Branch: refs/heads/master Commit: cd64fa339a97300c64dfc434483e478a58f507a8 Parents: 18f181a Author: Gilles <er...@apache.org> Authored: Thu Mar 2 13:40:14 2017 +0100 Committer: Gilles <er...@apache.org> Committed: Thu Mar 2 13:40:14 2017 +0100 ---------------------------------------------------------------------- .../inference/KolmogorovSmirnovTestTest.java | 32 +++++++++++--------- 1 file changed, 18 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-math/blob/cd64fa33/src/test/java/org/apache/commons/math4/stat/inference/KolmogorovSmirnovTestTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/stat/inference/KolmogorovSmirnovTestTest.java b/src/test/java/org/apache/commons/math4/stat/inference/KolmogorovSmirnovTestTest.java index 389acbe..c3aa553 100644 --- a/src/test/java/org/apache/commons/math4/stat/inference/KolmogorovSmirnovTestTest.java +++ b/src/test/java/org/apache/commons/math4/stat/inference/KolmogorovSmirnovTestTest.java @@ -436,24 +436,28 @@ public class KolmogorovSmirnovTestTest { Assert.assertEquals(0.9792777290, test.kolmogorovSmirnovTest(x, y), 1e-6); } - + @Test public void testTwoSampleWithManyTiesAndVerySmallDelta() { - // MATH-1405 + // Cf. MATH-1405 final double[] x = { - 0.000000, 0.000000, 1.000000, - 1.000000, 1.500000, 1.600000, - 1.700000, 1.800000, 1.900000, 2.000000, 2.000000000000001 }; - + 0.000000, 0.000000, 1.000000, + 1.000000, 1.500000, 1.600000, + 1.700000, 1.800000, 1.900000, 2.000000, 2.000000000000001 + }; + final double[] y = { - 0.000000, 0.000000, 10.000000, - 10.000000, 11.000000, 11.000000, - 11.000000, 15.000000, 16.000000, - 17.000000, 18.000000, 19.000000, 20.000000, 20.000000000000001 }; - - // these values result in an initial calculated minDelta of 4.440892098500626E-16, - // which is too small to jitter the existing values to new ones bc of floating-point precision - // MATH-1405 added functionality to iteratively increase minDelta until a noticeable jitter occurs + 0.000000, 0.000000, 10.000000, + 10.000000, 11.000000, 11.000000, + 11.000000, 15.000000, 16.000000, + 17.000000, 18.000000, 19.000000, 20.000000, 20.000000000000001 + }; + + // These values result in an initial calculated minDelta of 4.440892098500626E-16, + // which is too small to jitter the existing values to new ones bc of floating-point + // precision. + // MATH-1405 adds functionality to iteratively increase minDelta until a noticeable + // jitter occurs. final KolmogorovSmirnovTest test = new KolmogorovSmirnovTest(); Assert.assertEquals(1.12173015e-5, test.kolmogorovSmirnovTest(x, y), 1e-6);