Class FloatHistogram

java.lang.Object
com.tdunning.math.stats.FloatHistogram
All Implemented Interfaces:
Serializable

public class FloatHistogram extends Object implements 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 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

      public void writeObject(ObjectOutputStream out) throws IOException
      Throws:
      IOException
    • readObject

      public void readObject(ObjectInputStream in) throws IOException
      Throws:
      IOException
    • readObjectNoData

      private void readObjectNoData() throws ObjectStreamException
      Throws:
      ObjectStreamException