Class ThetaUtil
java.lang.Object
org.apache.datasketches.thetacommon.ThetaUtil
Utility methods for the Theta Family of sketches
- Author:
- Lee Rhodes
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default nominal entries is provided as a convenience for those cases where the nominal sketch size in number of entries is not provided.static final intThe largest Log2 nom entries allowed: 26.static final intThe smallest Log2 cache size allowed: 5.static final intThe smallest Log2 nom entries allowed: 4.static final doubleThe hash table rebuild threshold = 15.0/16.0.static final doubleThe resize threshold = 0.5; tuned for speed. -
Method Summary
Modifier and TypeMethodDescriptionstatic intcheckNomLongs(int nomLongs) Checks that the given nomLongs is within bounds and returns the Log2 of the ceiling power of 2 of the given nomLongs.static intstartingSubMultiple(int lgTarget, int lgRF, int lgMin) Gets the smallest allowed exponent of 2 that it is a sub-multiple of the target by zero, one or more resize factors.
-
Field Details
-
MIN_LG_NOM_LONGS
public static final int MIN_LG_NOM_LONGSThe smallest Log2 nom entries allowed: 4.- See Also:
-
MAX_LG_NOM_LONGS
public static final int MAX_LG_NOM_LONGSThe largest Log2 nom entries allowed: 26.- See Also:
-
REBUILD_THRESHOLD
public static final double REBUILD_THRESHOLDThe hash table rebuild threshold = 15.0/16.0.- See Also:
-
RESIZE_THRESHOLD
public static final double RESIZE_THRESHOLDThe resize threshold = 0.5; tuned for speed.- See Also:
-
DEFAULT_NOMINAL_ENTRIES
public static final int DEFAULT_NOMINAL_ENTRIESThe default nominal entries is provided as a convenience for those cases where the nominal sketch size in number of entries is not provided. A sketch of 4096 entries has a Relative Standard Error (RSE) of +/- 1.56% at a confidence of 68%; or equivalently, a Relative Error of +/- 3.1% at a confidence of 95.4%. See Default Nominal Entries- See Also:
-
MIN_LG_ARR_LONGS
public static final int MIN_LG_ARR_LONGSThe smallest Log2 cache size allowed: 5.- See Also:
-
-
Method Details
-
startingSubMultiple
public static int startingSubMultiple(int lgTarget, int lgRF, int lgMin) Gets the smallest allowed exponent of 2 that it is a sub-multiple of the target by zero, one or more resize factors.- Parameters:
lgTarget- Log2 of the target sizelgRF- Log_base2 of Resize Factor. See Resize FactorlgMin- Log2 of the minimum allowed starting size- Returns:
- The Log2 of the starting size
-
checkNomLongs
public static int checkNomLongs(int nomLongs) Checks that the given nomLongs is within bounds and returns the Log2 of the ceiling power of 2 of the given nomLongs.- Parameters:
nomLongs- the given number of nominal longs. This can be any value from 16 to 67108864, inclusive.- Returns:
- The Log2 of the ceiling power of 2 of the given nomLongs.
-