Remove deprecated method medianOf3 in Percentile.

This commit is contained in:
tn 2015-02-19 09:52:49 +01:00
parent 24e3c8632e
commit 6e368658c4
2 changed files with 0 additions and 31 deletions

View File

@ -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).

View File

@ -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;