Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

lemur::utility::Counter Class Reference

Abstract Counter class. More...

#include <Counter.hpp>

Inheritance diagram for lemur::utility::Counter:

lemur::utility::ModifiableCounter lemur::utility::ArrayCounter< T > lemur::utility::ArrayCounter< double > lemur::utility::ArrayCounter< int > lemur::langmod::RelDocUnigramCounter lemur::langmod::DocUnigramCounter List of all members.

Public Member Functions

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

Detailed Description

Abstract Counter class.

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.


Constructor & Destructor Documentation

virtual lemur::utility::Counter::~Counter  )  [inline, virtual]
 


Member Function Documentation

virtual double lemur::utility::Counter::count int  eventIndex  )  const [pure virtual]
 

return the count of a word

Implemented in lemur::utility::ArrayCounter< T >, lemur::utility::ArrayCounter< double >, and lemur::utility::ArrayCounter< int >.

virtual bool lemur::utility::Counter::hasMore  )  const [pure virtual]
 

Implemented in lemur::utility::ArrayCounter< T >, lemur::utility::ArrayCounter< double >, and lemur::utility::ArrayCounter< int >.

virtual void lemur::utility::Counter::nextCount int &  eventIndex,
double &  count
const [pure virtual]
 

Implemented in lemur::utility::ArrayCounter< T >, lemur::utility::ArrayCounter< double >, and lemur::utility::ArrayCounter< int >.

virtual void lemur::utility::Counter::startIteration  )  const [pure virtual]
 

iteration over non-zero counts

Implemented in lemur::utility::ArrayCounter< T >, lemur::utility::ArrayCounter< double >, and lemur::utility::ArrayCounter< int >.

virtual double lemur::utility::Counter::sum  )  const [pure virtual]
 

return the sum of all counts

Implemented in lemur::utility::ArrayCounter< T >, lemur::utility::ArrayCounter< double >, and lemur::utility::ArrayCounter< int >.


The documentation for this class was generated from the following file:
Generated on Tue Jun 15 11:03:07 2010 for Lemur by doxygen 1.3.4