Package com.tdunning.math.stats
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 TypeMethodDescriptionvoid
add
(double v) (package private) int
bucket
(double x) private int
bucketIndex
(double x) double[]
long[]
long[]
private double
lowerBound
(int k) void
private void
void
-
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
-