Class DiscreteProbabilityBuffer
java.lang.Object
io.nosqlbench.virtdata.library.basics.core.stathelpers.DiscreteProbabilityBuffer
- All Implemented Interfaces:
Iterable<DiscreteProbabilityBuffer.Entry>
public class DiscreteProbabilityBuffer
extends Object
implements Iterable<DiscreteProbabilityBuffer.Entry>
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
RECORD_LEN
public static int RECORD_LEN
-
-
Constructor Details
-
DiscreteProbabilityBuffer
public DiscreteProbabilityBuffer(int entries)
-
-
Method Details
-
add
-
normalize
public void normalize(double phi) Normalize the dataset, but only if the cumulative probability is not close to the unit probability of 1.0D, within some phi threshold. In either case, mark the dataset as normalized.- Parameters:
phi- A double value, preferably very small, like 0.000000001D
-
normalize
public void normalize() -
iterator
- Specified by:
iteratorin interfaceIterable<DiscreteProbabilityBuffer.Entry>
-
getCumulativeProbability
public double getCumulativeProbability()
-