Class IncludeMinMax
java.lang.Object
org.apache.datasketches.quantilescommon.IncludeMinMax
This class reinserts the min and max values into the sorted view arrays as required.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A simple structure to hold a pair of arraysstatic class
A simple structure to hold a pair of arraysstatic class
A simple structure to hold a pair of arraysstatic class
A simple structure to hold a pair of arrays -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic IncludeMinMax.DoublesPair
includeDoublesMinMax
(double[] quantilesIn, long[] cumWeightsIn, double maxItem, double minItem) The logic to include the min and max of type double.static IncludeMinMax.FloatsPair
includeFloatsMinMax
(float[] quantilesIn, long[] cumWeightsIn, float maxItem, float minItem) The logic to include the min and max of type float.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.static IncludeMinMax.LongsPair
includeLongsMinMax
(long[] quantilesIn, long[] cumWeightsIn, long maxItem, long minItem) The logic to include the min and max of type double.
-
Constructor Details
-
IncludeMinMax
public IncludeMinMax()
-
-
Method Details
-
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 quantilescumWeightsIn
- The array of associated cumulative weightsmaxItem
- the maximum item of the streamminItem
- the minimum item of the stream- Returns:
- a DoublesPair
-
includeLongsMinMax
public static IncludeMinMax.LongsPair includeLongsMinMax(long[] quantilesIn, long[] cumWeightsIn, long maxItem, long minItem) The logic to include the min and max of type double.- Parameters:
quantilesIn
- The array of quantilescumWeightsIn
- The array of associated cumulative weightsmaxItem
- the maximum item of the streamminItem
- 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 quantilescumWeightsIn
- The array of associated cumulative weightsmaxItem
- the maximum item of the streamminItem
- 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 quantilescumWeightsIn
- The array of associated cumulative weightsmaxItem
- the maximum item of the streamminItem
- the minimum item of the streamcomparator
- a comparator for type T- Returns:
- an ItemsPair
-