Class IncludeMinMax


  • public class IncludeMinMax
    extends Object
    This class reinserts the min and max values into the sorted view arrays as required.
    • Constructor Detail

      • IncludeMinMax

        public IncludeMinMax()
    • Method Detail

      • includeDoublesMinMax

        public static IncludeMinMax.DoublesPair includeDoublesMinMax​(double[] quantilesIn,
                                                                     long[] cumWeightsIn,
                                                                     double maxItem,
                                                                     double minItem)
        The logic to include the min and max of type double.
        Parameters:
        quantilesIn - The array of quantiles
        cumWeightsIn - The array of associated cumulative weights
        maxItem - the maximum item of the stream
        minItem - the minimum item of the stream
        Returns:
        a DoublesPair
      • includeFloatsMinMax

        public static IncludeMinMax.FloatsPair includeFloatsMinMax​(float[] quantilesIn,
                                                                   long[] cumWeightsIn,
                                                                   float maxItem,
                                                                   float minItem)
        The logic to include the min and max of type float.
        Parameters:
        quantilesIn - The array of quantiles
        cumWeightsIn - The array of associated cumulative weights
        maxItem - the maximum item of the stream
        minItem - the minimum item of the stream
        Returns:
        a FloatsPair
      • includeItemsMinMax

        public static <T> IncludeMinMax.ItemsPair<T> includeItemsMinMax​(T[] quantilesIn,
                                                                        long[] cumWeightsIn,
                                                                        T maxItem,
                                                                        T minItem,
                                                                        Comparator<? super T> comparator)
        The logic to include the min and max of type T.
        Type Parameters:
        T - the item class type
        Parameters:
        quantilesIn - The array of quantiles
        cumWeightsIn - The array of associated cumulative weights
        maxItem - the maximum item of the stream
        minItem - the minimum item of the stream
        comparator - a comparator for type T
        Returns:
        an ItemsPair