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

lemur::cluster::FlatFileClusterDB Class Reference

Writes one file, name.cl, the cluster database. More...

#include <FlatFileClusterDB.hpp>

Inheritance diagram for lemur::cluster::FlatFileClusterDB:

lemur::api::ClusterDB List of all members.

Public Member Functions

 FlatFileClusterDB (const lemur::api::Index *ind, const string &name, double threshold=0.25, enum ClusterParam::simTypes simType=ClusterParam::COS, enum ClusterParam::clusterTypes clusterType=ClusterParam::CENTROID, enum ClusterParam::docModes docMode=ClusterParam::DMAX)
 initialize

virtual ~FlatFileClusterDB ()
 clean up

virtual vector< Cluster * > getDocCluster (lemur::api::DOCID_T docId) const
 Get the Cluster for the given docId.

virtual int countClusters () const
 Count number of clusters.

virtual int maxID () const
 Return highest cluster ID.

virtual ClustergetCluster (int clusterId) const
 Get the Cluster for the given clusterId.

virtual vector< int > getDocClusterId (lemur::api::DOCID_T docId) const
 Get the Cluster id for the given docId.

virtual int addToCluster (lemur::api::DOCID_T docId, int clusterId, double score)
 Add a document id to a cluster, given the cluster id.

virtual int addToCluster (lemur::api::DOCID_T docId, Cluster *cluster, double score)
 Add a document id to a cluster, given the cluster.

virtual int removeFromCluster (lemur::api::DOCID_T docId, int clusterID)
 Remove a document id from a cluster, given the cluster id.

virtual int deleteCluster (int clusterID)
 Delete a cluster entirely.

virtual int deleteCluster (Cluster *cluster)
 Delete a cluster entirely.

virtual vector< int > splitCluster (int cid, int num=2)
 split cluster -- using Cluster::split.

virtual int mergeClusters (int cid1, int cid2)
 merge two clusters.


Protected Member Functions

virtual ClusternewCluster ()
 Factory method for creating Cluster objects.


Private Member Functions

void readClusterDB ()
void writeClusterDB ()
void init (const string &name)

Private Attributes

int clusterCount
int clusterIdCounter
string clusterDB
int * doc2cluster
 the document id to cluster id table.


Detailed Description

Writes one file, name.cl, the cluster database.


Constructor & Destructor Documentation

lemur::cluster::FlatFileClusterDB::FlatFileClusterDB const lemur::api::Index ind,
const string &  name,
double  threshold = 0.25,
enum ClusterParam::simTypes  simType = ClusterParam::COS,
enum ClusterParam::clusterTypes  clusterType = ClusterParam::CENTROID,
enum ClusterParam::docModes  docMode = ClusterParam::DMAX
 

initialize

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

clean up


Member Function Documentation

int lemur::cluster::FlatFileClusterDB::addToCluster lemur::api::DOCID_T  docId,
Cluster cluster,
double  score
[virtual]
 

Add a document id to a cluster, given the cluster.

Implements lemur::api::ClusterDB.

int lemur::cluster::FlatFileClusterDB::addToCluster lemur::api::DOCID_T  docId,
int  clusterId,
double  score
[virtual]
 

Add a document id to a cluster, given the cluster id.

Implements lemur::api::ClusterDB.

virtual int lemur::cluster::FlatFileClusterDB::countClusters  )  const [inline, virtual]
 

Count number of clusters.

Implements lemur::api::ClusterDB.

int lemur::cluster::FlatFileClusterDB::deleteCluster Cluster cluster  )  [virtual]
 

Delete a cluster entirely.

Implements lemur::api::ClusterDB.

int lemur::cluster::FlatFileClusterDB::deleteCluster int  clusterID  )  [virtual]
 

Delete a cluster entirely.

Implements lemur::api::ClusterDB.

lemur::cluster::Cluster * lemur::cluster::FlatFileClusterDB::getCluster int  clusterId  )  const [virtual]
 

Get the Cluster for the given clusterId.

Implements lemur::api::ClusterDB.

vector< lemur::cluster::Cluster * > lemur::cluster::FlatFileClusterDB::getDocCluster lemur::api::DOCID_T  docId  )  const [virtual]
 

Get the Cluster for the given docId.

Implements lemur::api::ClusterDB.

vector< int > lemur::cluster::FlatFileClusterDB::getDocClusterId lemur::api::DOCID_T  docId  )  const [virtual]
 

Get the Cluster id for the given docId.

Implements lemur::api::ClusterDB.

void lemur::cluster::FlatFileClusterDB::init const string &  name  )  [private]
 

virtual int lemur::cluster::FlatFileClusterDB::maxID  )  const [inline, virtual]
 

Return highest cluster ID.

Implements lemur::api::ClusterDB.

int lemur::cluster::FlatFileClusterDB::mergeClusters int  cid1,
int  cid2
[virtual]
 

merge two clusters.

Implements lemur::api::ClusterDB.

lemur::cluster::Cluster * lemur::cluster::FlatFileClusterDB::newCluster  )  [protected, virtual]
 

Factory method for creating Cluster objects.

Implements lemur::api::ClusterDB.

void lemur::cluster::FlatFileClusterDB::readClusterDB  )  [private]
 

int lemur::cluster::FlatFileClusterDB::removeFromCluster lemur::api::DOCID_T  docId,
int  clusterID
[virtual]
 

Remove a document id from a cluster, given the cluster id.

Implements lemur::api::ClusterDB.

vector< int > lemur::cluster::FlatFileClusterDB::splitCluster int  cid,
int  num = 2
[virtual]
 

split cluster -- using Cluster::split.

Implements lemur::api::ClusterDB.

void lemur::cluster::FlatFileClusterDB::writeClusterDB  )  [private]
 


Member Data Documentation

int lemur::cluster::FlatFileClusterDB::clusterCount [private]
 

string lemur::cluster::FlatFileClusterDB::clusterDB [private]
 

int lemur::cluster::FlatFileClusterDB::clusterIdCounter [private]
 

int* lemur::cluster::FlatFileClusterDB::doc2cluster [private]
 

the document id to cluster id table.


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