public final class QuantilesUtil extends Object
Modifier and Type | Field and Description |
---|---|
static double |
tailRoundingFactor
used in search to improve rounding over a wide dynamic range
|
Modifier and Type | Method and Description |
---|---|
static void |
checkDoublesSplitPointsOrder(double[] values)
Checks the sequential validity of the given array of double values.
|
static void |
checkFloatsSplitPointsOrder(float[] values)
Checks the sequential validity of the given array of float values.
|
static void |
checkLongsSplitPointsOrder(long[] values)
Checks the sequential validity of the given array of double values.
|
static void |
checkNormalizedRankBounds(double nRank)
Checks that the given normalized rank: 0 ≤ nRank ≤ 1.0.
|
static double[] |
equallySpacedDoubles(int num)
Returns an array of (num + 1) values that define equally sized intervals between 0.0, inclusive, and 1.0,
inclusive.
|
static long[] |
equallySpacedLongs(long min,
long max,
int num)
Returns an array of (num + 1) longs that define, approximately, equally spaced intervals between the given
max, inclusive, and min, inclusive.
|
static double[] |
evenlyLogSpaced(double value1,
double value2,
int num)
Returns a double array of values between min and max inclusive where the log of the
returned values are evenly spaced.
|
static double[] |
evenlySpacedDoubles(double value1,
double value2,
int num)
Returns a double array of evenly spaced values between value1, inclusive, and value2 inclusive.
|
static float[] |
evenlySpacedFloats(float value1,
float value2,
int num)
Returns a float array of evenly spaced values between value1, inclusive, and value2 inclusive.
|
static double |
getNaturalRank(double normalizedRank,
long totalN,
QuantileSearchCriteria searchCrit)
Computes the closest Natural Rank from a given Normalized Rank
|
public static final double tailRoundingFactor
public static final void checkNormalizedRankBounds(double nRank)
nRank
- the given normalized rank.public static final void checkDoublesSplitPointsOrder(double[] values)
values
- the given array of double valuespublic static void checkLongsSplitPointsOrder(long[] values)
values
- the given array of double valuespublic static final void checkFloatsSplitPointsOrder(float[] values)
values
- the given array of double valuespublic static double[] equallySpacedDoubles(int num)
For example, if num == 2, three values will be returned: 0.0, .5, and 1, where the two equally sized regions are {0.0,0.5}, and {0.5, 1.0}.
num
- the total number of equally sized intervals between 0.0, inclusive and 1.0, inclusive.
Must be 1 or greater.IllegalArgumentException
- if num is less than 1.public static long[] equallySpacedLongs(long min, long max, int num)
min
- the lowest positive valued (or zero) number of the rangemax
- the highest positive valued number of the range. max must be greater than minnum
- Number of requested intervals. Must be greater or equal to one, and less than or equal to
max - min.public static float[] evenlySpacedFloats(float value1, float value2, int num)
value1
- will be in index 0 of the returned arrayvalue2
- will be in the highest index of the returned arraynum
- the total number of values including value1 and value2. Must be 2 or greater.public static double[] evenlySpacedDoubles(double value1, double value2, int num)
value1
- will be in index 0 of the returned arrayvalue2
- will be in the highest index of the returned arraynum
- the total number of values including value1 and value2. Must be 2 or greater.public static double[] evenlyLogSpaced(double value1, double value2, int num)
value1
- will be in index 0 of the returned array, and must be greater than zero.value2
- will be in the highest index of the returned array, and must be greater than zero.num
- the total number of values including value1 and value2. Must be 2 or greaterpublic static double getNaturalRank(double normalizedRank, long totalN, QuantileSearchCriteria searchCrit)
normalizedRank
- the given normalized ranktotalN
- the total NsearchCrit
- the search criterion.Copyright © 2015–2024 The Apache Software Foundation. All rights reserved.