Class IncludeMinMax
- java.lang.Object
-
- org.apache.datasketches.quantilescommon.IncludeMinMax
-
public class IncludeMinMax extends Object
This class reinserts the min and max values into the sorted view arrays as required.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IncludeMinMax.DoublesPair
A simple structure to hold a pair of arraysstatic class
IncludeMinMax.FloatsPair
A simple structure to hold a pair of arraysstatic class
IncludeMinMax.ItemsPair<T>
A simple structure to hold a pair of arraysstatic class
IncludeMinMax.LongsPair
A simple structure to hold a pair of arrays
-
Constructor Summary
Constructors Constructor Description IncludeMinMax()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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.
-
-
-
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 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
-
-