29 #ifndef GRT_HIERARCHICAL_CLUSTERING_HEADER
30 #define GRT_HIERARCHICAL_CLUSTERING_HEADER
32 #include "../../CoreModules/Clusterer.h"
52 this->uniqueClusterID = rhs.uniqueClusterID;
53 this->clusterVariance = rhs.clusterVariance;
54 this->indexs = rhs.indexs;
60 UINT& operator[](
const UINT &i){
64 UINT operator[](
const UINT &i)
const{
68 void addSampleToCluster(UINT i){
69 indexs.push_back( i );
72 UINT getUniqueClusterID()
const{
73 return uniqueClusterID;
76 UINT getNumSamplesInCluster()
const{
77 return (UINT)indexs.size();
80 double getClusterVariance()
const{
81 return clusterVariance;
84 unsigned int uniqueClusterID;
85 double clusterVariance;
86 vector< UINT > indexs;
96 this->level = rhs.level;
97 this->clusters = rhs.clusters;
107 this->level = rhs.level;
108 this->clusters = rhs.clusters;
122 UINT getLevel()
const{
126 UINT getNumClusters()
const{
127 return (UINT)clusters.size();
131 vector< ClusterInfo > clusters;
177 virtual bool reset();
184 virtual bool clear();
230 vector< ClusterLevel > getClusters(){
return clusters; }
237 inline double SQR(
const double &a) {
return a*a;};
238 double squaredEuclideanDistance(
const double *a,
const double *b);
244 vector< ClusterLevel > clusters;
255 #endif //GRT_HIERARCHICAL_CLUSTERING_HEADER
virtual bool saveModelToFile(string filename) const
HierarchicalClustering & operator=(const HierarchicalClustering &rhs)
virtual bool loadModelFromFile(string filename)
virtual bool train_(MatrixDouble &data)
virtual bool loadModelFromFile(fstream &file)
virtual bool deepCopyFrom(const Clusterer *clusterer)
virtual bool saveModelToFile(fstream &file) const
virtual ~HierarchicalClustering()