common
Interface SetWithDistrib

All Known Implementing Classes:
Histogram, LogHistogram, SamplingMultiset

public interface SetWithDistrib

Interface for objects that represent a probability distribution over a set.


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.
 java.lang.Object sample()
          Returns an object sampled according to this distribution.
 

Method Detail

getProb

double getProb(java.lang.Object o)
Returns the probability of the given object under this distribution. Returns zero if the object is not in this set.


getLogProb

double getLogProb(java.lang.Object o)
Returns the natural log of the probability of the given object under this distribution. Returns Double.NEGATIVE_INFINITY if the object is not in this set.


sample

java.lang.Object sample()
Returns an object sampled according to this distribution. Returns null if this set is empty.