public final class TDigestDouble extends Object
Modifier and Type | Field and Description |
---|---|
static short |
DEFAULT_K
the default value of K if one is not specified
|
Constructor and Description |
---|
TDigestDouble()
Constructor with the default K
|
TDigestDouble(short k)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
compress()
Process buffered values and merge centroids if needed
|
short |
getK() |
double |
getMaxValue() |
double |
getMinValue() |
double |
getQuantile(double rank)
Compute approximate quantile value corresponding to the given normalized rank
|
double |
getRank(double value)
Compute approximate normalized rank of the given value.
|
long |
getTotalWeight() |
static TDigestDouble |
heapify(org.apache.datasketches.memory.Memory mem)
Deserialize TDigest from a given memory.
|
static TDigestDouble |
heapify(org.apache.datasketches.memory.Memory mem,
boolean isFloat)
Deserialize TDigest from a given memory.
|
boolean |
isEmpty() |
void |
merge(TDigestDouble other)
Merge the given TDigest into this one
|
byte[] |
toByteArray()
Serialize this TDigest to a byte array form.
|
String |
toString()
Human-readable summary of this TDigest as a string
|
String |
toString(boolean printCentroids)
Human-readable summary of this TDigest as a string
|
void |
update(double value)
Update this TDigest with the given value
|
public static final short DEFAULT_K
public TDigestDouble()
public TDigestDouble(short k)
k
- affects the size of TDigest and its estimation errorpublic short getK()
public void update(double value)
value
- to update the TDigest withpublic void merge(TDigestDouble other)
other
- TDigest to mergepublic void compress()
public boolean isEmpty()
public double getMinValue()
public double getMaxValue()
public long getTotalWeight()
public double getRank(double value)
value
- to be rankedpublic double getQuantile(double rank)
rank
- normalized rank (from 0 to 1 inclusive)public byte[] toByteArray()
public static TDigestDouble heapify(org.apache.datasketches.memory.Memory mem)
mem
- instance of Memorypublic static TDigestDouble heapify(org.apache.datasketches.memory.Memory mem, boolean isFloat)
mem
- instance of MemoryisFloat
- if true the input represents (float, int) formatpublic String toString()
public String toString(boolean printCentroids)
printCentroids
- if true append the list of centroids with weightsCopyright © 2015–2024 The Apache Software Foundation. All rights reserved.