|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.splout.db.benchmark.PositiveHistogram
public class PositiveHistogram
A class for computing approximated histograms, keeping a constant resolution, constant amount of memory, and without the needed of pre or post processing. WARNING: It only works for positive values. And if they are distributed far from 0, then will not work properly as well.
Field Summary | |
---|---|
protected int[] |
buckets
|
protected long |
count
|
protected double |
upperLimit
|
Constructor Summary | |
---|---|
PositiveHistogram(int bits,
double initialUpperLimit)
2^bits will be number of buckets. |
Method Summary | |
---|---|
void |
add(double value)
Add a new value to the histogram |
int |
bucketFor(java.lang.Double value)
Return the bucket index for a given value. |
int[] |
getBuckets()
Return the list of buckets. |
double |
getBucketSize()
|
long |
getCount()
Returns the number of elements that was added to the histogram. |
double |
getLeftAccumulatedProbability(double value)
Computes the accumulated probability for the values at the left of the provided value |
double[] |
getNormalizedHistogram()
|
double |
getRigthAccumulatedProbability(double value)
Computes the accumulated probability for the values at the right of the provided value |
double |
getUpperLimit()
Returns the maximum value that can be keep if the current histogram without needing to redistribute the buckets. |
protected void |
resize(double value)
|
java.lang.String |
toTSV()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int[] buckets
protected double upperLimit
protected long count
Constructor Detail |
---|
public PositiveHistogram(int bits, double initialUpperLimit)
Method Detail |
---|
public void add(double value)
protected void resize(double value)
public int bucketFor(java.lang.Double value)
public double getUpperLimit()
public int[] getBuckets()
getUpperLimit()
public long getCount()
public double getRigthAccumulatedProbability(double value)
public double getLeftAccumulatedProbability(double value)
public double[] getNormalizedHistogram()
public double getBucketSize()
public java.lang.String toTSV()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |