#include <Counter.hpp>
Inheritance diagram for Counter:
Public Methods | |
virtual | ~Counter () |
virtual double | count (int eventIndex) const=0 |
return the count of a word | |
virtual double | sum () const=0 |
return the sum of all counts | |
virtual void | startIteration () const=0 |
iteration over non-zero counts | |
virtual bool | hasMore () const=0 |
virtual void | nextCount (int &eventIndex, double &count) const=0 |
The double type, rather than int type, is used so that it may be useful in a setting like EM. The event index has a range [0,N]. The caller is responsible for boundary check if necessary.
|
|
|
return the count of a word
Implemented in ArrayCounter< T >, ArrayCounter< double >, and ArrayCounter< int >. |
|
Implemented in ArrayCounter< T >, ArrayCounter< double >, and ArrayCounter< int >. |
|
Implemented in ArrayCounter< T >, ArrayCounter< double >, and ArrayCounter< int >. |
|
iteration over non-zero counts
Implemented in ArrayCounter< T >, ArrayCounter< double >, and ArrayCounter< int >. |
|
return the sum of all counts
Implemented in ArrayCounter< T >, ArrayCounter< double >, and ArrayCounter< int >. |