Class MedianOf3PivotingStrategy
- java.lang.Object
-
- org.apache.commons.math4.legacy.stat.descriptive.rank.MedianOf3PivotingStrategy
-
- All Implemented Interfaces:
PivotingStrategy
public class MedianOf3PivotingStrategy extends Object implements PivotingStrategy
Classic median of 3 strategy given begin and end indices.- Since:
- 3.4
-
-
Constructor Summary
Constructors Constructor Description MedianOf3PivotingStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
pivotIndex(double[] work, int begin, int end)
Find pivot index of the array so that partition and Kth element selection can be made.
-
-
-
Constructor Detail
-
MedianOf3PivotingStrategy
public MedianOf3PivotingStrategy()
-
-
Method Detail
-
pivotIndex
public int pivotIndex(double[] work, int begin, int end)
Find pivot index of the array so that partition and Kth element selection can be made. This in specific makes use of median of 3 pivoting.- Specified by:
pivotIndex
in interfacePivotingStrategy
- Parameters:
work
- data arraybegin
- index of the first element of the sliceend
- index after the last element of the slice- Returns:
- The index corresponding to a pivot chosen between the first, middle and the last indices of the array slice
- Throws:
MathIllegalArgumentException
- MathIllegalArgumentException when indices exceeds range
-
-