public class IntHistogram
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int[] |
hist |
private boolean |
isSumComputed |
private int |
max |
private int |
min |
private int |
nBuckets |
private int |
nBucketSize |
private int |
nTups |
private int[] |
sum |
Constructor and Description |
---|
IntHistogram(int buckets,
int min,
int max)
Create a new IntHistogram.
|
Modifier and Type | Method and Description |
---|---|
void |
addValue(int v)
Add a value to the set of values that you are keeping a histogram of.
|
double |
avgSelectivity() |
double |
estimateSelectivity(Predicate.Op op,
int v)
Estimate the selectivity of a particular predicate and operand on this table.
|
private int |
getSum(int i,
int j)
Returns Sum( hist[i..j] )
|
java.lang.String |
toString() |
private int nBuckets
private int nBucketSize
private int min
private int max
private int[] hist
private int[] sum
private boolean isSumComputed
private int nTups
public IntHistogram(int buckets, int min, int max)
buckets
- The number of buckets to split the input value into.min
- The minimum integer value that will ever be passed to this class for histogrammingmax
- The maximum integer value that will ever be passed to this class for histogrammingpublic void addValue(int v)
v
- Value to add to the histogramprivate int getSum(int i, int j)
i
- j
- public double estimateSelectivity(Predicate.Op op, int v)
op
- Operatorv
- Valuepublic double avgSelectivity()
public java.lang.String toString()
toString
in class java.lang.Object