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

lemur::cluster::ClusterRep Class Reference

Generic vector space representation for a cluster or document. More...

#include <ClusterRep.hpp>

List of all members.

Public Member Functions

 ClusterRep (const lemur::api::Index &ind)
 Empty rep.

 ClusterRep (lemur::api::DOCID_T did, const lemur::api::Index &ind)
 Rep for given document id.

 ClusterRep (lemur::api::TermInfoList *tList, const lemur::api::Index &ind)
 Rep for given TermInfoList.

 ClusterRep (vector< lemur::api::DOCID_T > &dids, const lemur::api::Index &ind)
 Rep for given vector of document ids.

 ClusterRep (lemur::utility::FloatFreqVector *v, const lemur::api::Index &ind)
 Rep for the given vector.

 ClusterRep (const ClusterRep *old)
 Copy constructor.

virtual ~ClusterRep ()
 clean up.

virtual void normalize ()
 divide each element by the square root of the sum of the squared elements in the vector.

double sum2 () const
 sum of the squared elements in the vector.

lemur::utility::FloatFreqVectorgetRep () const
 get the underlying frequency vector.

void weigh (const double *vals)
 multiply each element by the corresponding entry in vals. Destructively modifies the vector

void weigh (double val)
 multiply each element by val. Destructively modifies the vector

void addVal (int id, double val)
 add val to each element in the vector. Destructively modifies the vector

void addTerms (const vector< lemur::api::TERMID_T > &tids)
 add 1 to each element in the vector specified in tids. Destructively modifies the vector

void addVec (const ClusterRep *v2)
 adds vector to rep. Destructively modifies the vector

void subtract (const ClusterRep *v2)
 subtracts vector from rep. Destructively modifies the vector

double dotProd (const ClusterRep *v2) const
 computes dot product between two reps.


Private Attributes

lemur::utility::FloatFreqVectorrep
const lemur::api::Indexindex


Detailed Description

Generic vector space representation for a cluster or document.


Constructor & Destructor Documentation

lemur::cluster::ClusterRep::ClusterRep const lemur::api::Index ind  )  [inline]
 

Empty rep.

lemur::cluster::ClusterRep::ClusterRep lemur::api::DOCID_T  did,
const lemur::api::Index ind
 

Rep for given document id.

lemur::cluster::ClusterRep::ClusterRep lemur::api::TermInfoList tList,
const lemur::api::Index ind
 

Rep for given TermInfoList.

lemur::cluster::ClusterRep::ClusterRep vector< lemur::api::DOCID_T > &  dids,
const lemur::api::Index ind
 

Rep for given vector of document ids.

lemur::cluster::ClusterRep::ClusterRep lemur::utility::FloatFreqVector v,
const lemur::api::Index ind
 

Rep for the given vector.

lemur::cluster::ClusterRep::ClusterRep const ClusterRep old  ) 
 

Copy constructor.

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

clean up.


Member Function Documentation

void lemur::cluster::ClusterRep::addTerms const vector< lemur::api::TERMID_T > &  tids  )  [inline]
 

add 1 to each element in the vector specified in tids. Destructively modifies the vector

void lemur::cluster::ClusterRep::addVal int  id,
double  val
[inline]
 

add val to each element in the vector. Destructively modifies the vector

void lemur::cluster::ClusterRep::addVec const ClusterRep v2  )  [inline]
 

adds vector to rep. Destructively modifies the vector

double lemur::cluster::ClusterRep::dotProd const ClusterRep v2  )  const [inline]
 

computes dot product between two reps.

lemur::utility::FloatFreqVector* lemur::cluster::ClusterRep::getRep  )  const [inline]
 

get the underlying frequency vector.

void lemur::cluster::ClusterRep::normalize  )  [virtual]
 

divide each element by the square root of the sum of the squared elements in the vector.

void lemur::cluster::ClusterRep::subtract const ClusterRep v2  )  [inline]
 

subtracts vector from rep. Destructively modifies the vector

double lemur::cluster::ClusterRep::sum2  )  const [inline]
 

sum of the squared elements in the vector.

void lemur::cluster::ClusterRep::weigh double  val  )  [inline]
 

multiply each element by val. Destructively modifies the vector

void lemur::cluster::ClusterRep::weigh const double *  vals  )  [inline]
 

multiply each element by the corresponding entry in vals. Destructively modifies the vector


Member Data Documentation

const lemur::api::Index& lemur::cluster::ClusterRep::index [private]
 

lemur::utility::FloatFreqVector* lemur::cluster::ClusterRep::rep [private]
 


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