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

lemur::cluster::CosSim Class Reference

Cosine similarity method for vector space comparisons. More...

#include <CosSim.hpp>

Inheritance diagram for lemur::cluster::CosSim:

lemur::cluster::SimilarityMethod List of all members.

Public Member Functions

 CosSim (const lemur::api::Index &dbIndex)
 Precomputes the idf values for the collection.

virtual ~CosSim ()
 clean up

void weigh (ClusterRep *rep) const
 normalize rep with idf values.

double similarity (const ClusterRep *vec1, const ClusterRep *vec2) const
 compute similarity between two reps.

const double * idfValues () const
 return pointer to precomputed idf values.


Protected Attributes

const lemur::api::Indexind
double * idfV
int numDocs
int numTerms

Detailed Description

Cosine similarity method for vector space comparisons.


Constructor & Destructor Documentation

lemur::cluster::CosSim::CosSim const lemur::api::Index dbIndex  ) 
 

Precomputes the idf values for the collection.

Cosine similarity method. Precomputes the idf values for the collection.

lemur::cluster::CosSim::~CosSim  )  [virtual]
 

clean up


Member Function Documentation

const double* lemur::cluster::CosSim::idfValues  )  const [inline]
 

return pointer to precomputed idf values.

double lemur::cluster::CosSim::similarity const ClusterRep vec1,
const ClusterRep vec2
const [virtual]
 

compute similarity between two reps.

Implements lemur::cluster::SimilarityMethod.

void lemur::cluster::CosSim::weigh ClusterRep rep  )  const [inline, virtual]
 

normalize rep with idf values.

Reimplemented from lemur::cluster::SimilarityMethod.


Member Data Documentation

double* lemur::cluster::CosSim::idfV [protected]
 

const lemur::api::Index& lemur::cluster::CosSim::ind [protected]
 

int lemur::cluster::CosSim::numDocs [protected]
 

int lemur::cluster::CosSim::numTerms [protected]
 


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