Class CentralPivotingStrategy

    • 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 particular picks a average of begin and end indices
        Specified by:
        pivotIndex in interface PivotingStrategy
        Parameters:
        work - data array
        begin - index of the first element of the slice
        end - index after the last element of the slice
        Returns:
        The index corresponding to a simple average of the first and the last element indices of the array slice
        Throws:
        MathIllegalArgumentException - MathIllegalArgumentException when indices exceeds range