edu.umd.cloud9.util.count
Interface Object2IntConditionalFrequencyDistribution<K extends Comparable<K>>

All Known Implementing Classes:
OpenObject2IntConditionalFrequencyDistribution

public interface Object2IntConditionalFrequencyDistribution<K extends Comparable<K>>

A conditional frequency distribution where events are arbitrary objects and counts are ints.

Author:
Jimmy Lin

Method Summary
 void check()
          Performs an internal consistency check of this data structure.
 int get(K k, K cond)
          Returns the observed frequency of k conditioned on cond.
 Object2IntFrequencyDistribution<K> getConditionalDistribution(K cond)
          Returns the frequency distribution conditioned on cond.
 int getMarginalCount(K k)
          Returns the marginal count of k.
 long getSumOfAllFrequencies()
          Returns the sum of all frequencies.
 void increment(K k, K cond)
          Increments the observed frequency of k conditioned on cond.
 void increment(K k, K cond, int v)
          Increments the observed frequency of k conditioned on cond by v.
 void set(K k, K cond, int v)
          Sets the observed frequency of k conditioned on cond to v.
 

Method Detail

set

void set(K k,
         K cond,
         int v)
Sets the observed frequency of k conditioned on cond to v.


increment

void increment(K k,
               K cond)
Increments the observed frequency of k conditioned on cond.


increment

void increment(K k,
               K cond,
               int v)
Increments the observed frequency of k conditioned on cond by v.


get

int get(K k,
        K cond)
Returns the observed frequency of k conditioned on cond.


getMarginalCount

int getMarginalCount(K k)
Returns the marginal count of k. That is, sum of counts of k conditioned on all cond.


getConditionalDistribution

Object2IntFrequencyDistribution<K> getConditionalDistribution(K cond)
Returns the frequency distribution conditioned on cond.


getSumOfAllFrequencies

long getSumOfAllFrequencies()
Returns the sum of all frequencies.


check

void check()
Performs an internal consistency check of this data structure. An exception will be thrown if an error is found.