|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcommon.LogHistogram
public class LogHistogram
A histogram that stores the logs of the weights of its elements, rather than the weights themselves.
Constructor Summary | |
---|---|
LogHistogram()
Creates a new LogHistogram with no elements. |
|
LogHistogram(boolean sorted)
Creates a new LogHistogram with no elements. |
Method Summary | |
---|---|
double |
getLogProb(java.lang.Object o)
Returns the natural log of the probability of the given object under this distribution. |
double |
getProb(java.lang.Object o)
Returns the probability of the given object under this distribution. |
void |
increaseWeight(java.lang.Object o,
double logIncrement)
Increases the weight of the given object by an amount whose logarithm is the given value. |
java.lang.Object |
sample()
Returns an object sampled according to this distribution. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LogHistogram()
public LogHistogram(boolean sorted)
sorted
- if true, use a sorted map from elements to log weightsMethod Detail |
---|
public double getProb(java.lang.Object o)
SetWithDistrib
getProb
in interface SetWithDistrib
public double getLogProb(java.lang.Object o)
SetWithDistrib
getLogProb
in interface SetWithDistrib
public java.lang.Object sample()
SetWithDistrib
sample
in interface SetWithDistrib
public void increaseWeight(java.lang.Object o, double logIncrement)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |