Remove deprecated method medianOf3 in Percentile.
Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/6e368658 Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/6e368658 Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/6e368658 Branch: refs/heads/master Commit: 6e368658c4e055240fbc1da53f2972c291af7395 Parents: 24e3c86 Author: tn <thomas.neidh...@gmail.com> Authored: Thu Feb 19 09:52:49 2015 +0100 Committer: tn <thomas.neidh...@gmail.com> Committed: Thu Feb 19 09:52:49 2015 +0100 ---------------------------------------------------------------------- .../math4/stat/descriptive/rank/Percentile.java | 21 -------------------- .../stat/descriptive/rank/PercentileTest.java | 10 ---------- 2 files changed, 31 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-math/blob/6e368658/src/main/java/org/apache/commons/math4/stat/descriptive/rank/Percentile.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/rank/Percentile.java b/src/main/java/org/apache/commons/math4/stat/descriptive/rank/Percentile.java index 499123d..93640c5 100644 --- a/src/main/java/org/apache/commons/math4/stat/descriptive/rank/Percentile.java +++ b/src/main/java/org/apache/commons/math4/stat/descriptive/rank/Percentile.java @@ -354,27 +354,6 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa estimationType.evaluate(work, pivotsHeap, p, kthSelector); } - /** Select a pivot index as the median of three - * <p> - * <b>Note:</b> With the effect of allowing {@link KthSelector} to be set on - * {@link Percentile} instances(thus indirectly {@link PivotingStrategy}) - * this method wont take effect any more and hence is unsupported. - * @param work data array - * @param begin index of the first element of the slice - * @param end index after the last element of the slice - * @return the index of the median element chosen between the - * first, the middle and the last element of the array slice - * @deprecated Please refrain from using this method (as it wont take effect) - * and instead use {@link Percentile#withKthSelector(newKthSelector)} if - * required. - * - */ - @Deprecated - int medianOf3(final double[] work, final int begin, final int end) { - return new MedianOf3PivotingStrategy().pivotIndex(work, begin, end); - //throw new MathUnsupportedOperationException(); - } - /** * Returns the value of the quantile field (determines what percentile is * computed when evaluate() is called with no quantile argument). http://git-wip-us.apache.org/repos/asf/commons-math/blob/6e368658/src/test/java/org/apache/commons/math4/stat/descriptive/rank/PercentileTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/stat/descriptive/rank/PercentileTest.java b/src/test/java/org/apache/commons/math4/stat/descriptive/rank/PercentileTest.java index 3aa055f..bd67c5a 100644 --- a/src/test/java/org/apache/commons/math4/stat/descriptive/rank/PercentileTest.java +++ b/src/test/java/org/apache/commons/math4/stat/descriptive/rank/PercentileTest.java @@ -28,7 +28,6 @@ import org.apache.commons.math4.random.RandomGenerator; import org.apache.commons.math4.random.Well1024a; import org.apache.commons.math4.stat.descriptive.UnivariateStatistic; import org.apache.commons.math4.stat.descriptive.UnivariateStatisticAbstractTest; -import org.apache.commons.math4.stat.descriptive.rank.Percentile; import org.apache.commons.math4.stat.descriptive.rank.Percentile.EstimationType; import org.apache.commons.math4.stat.ranking.NaNStrategy; import org.apache.commons.math4.util.CentralPivotingStrategy; @@ -620,15 +619,6 @@ public class PercentileTest extends UnivariateStatisticAbstractTest{ Assert.assertEquals(12.16d, p.evaluate(60d), 0d); } - @SuppressWarnings("deprecation") - @Test - public void testMedianOf3() { - reset(50.0, Percentile.EstimationType.R_7); - final Percentile p = getUnivariateStatistic(); - Assert.assertEquals(0, p.medianOf3(testArray, 0, testArray.length)); - Assert.assertEquals(10, p.medianOf3(testWeightsArray, 0, testWeightsArray.length)); - } - @Test(expected=NullArgumentException.class) public void testNullEstimation() { type = null;