Class FloatHistogram
java.lang.Object
com.tdunning.math.stats.FloatHistogram
- All Implemented Interfaces:
Serializable
Maintains histogram buckets that are constant width
in base-2 floating point representation space. This is close
to exponential binning, but should be much faster.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFloatHistogram(double min, double max) FloatHistogram(double min, double max, double binsPerDecade) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(double v) (package private) intbucket(double x) private intbucketIndex(double x) double[]long[]long[]private doublelowerBound(int k) voidprivate voidvoid
-
Field Details
-
counts
private long[] counts -
min
private double min -
max
private double max -
bitsOfPrecision
private int bitsOfPrecision -
shift
private int shift -
offset
private int offset
-
-
Constructor Details
-
FloatHistogram
FloatHistogram() -
FloatHistogram
public FloatHistogram(double min, double max) -
FloatHistogram
public FloatHistogram(double min, double max, double binsPerDecade)
-
-
Method Details
-
bucket
int bucket(double x) -
bucketIndex
private int bucketIndex(double x) -
lowerBound
private double lowerBound(int k) -
add
public void add(double v) -
getBounds
public double[] getBounds() -
getCounts
public long[] getCounts() -
getCompressedCounts
public long[] getCompressedCounts() -
writeObject
- Throws:
IOException
-
readObject
- Throws:
IOException
-
readObjectNoData
- Throws:
ObjectStreamException
-