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 Float getClusterVariance()
const{
81 return clusterVariance;
84 unsigned int uniqueClusterID;
85 Float clusterVariance;
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();
177 virtual bool reset();
184 virtual bool clear();
237 inline Float SQR(
const Float &a) {
return a*a;};
238 Float squaredEuclideanDistance(
const Float *a,
const Float *b);
254 #endif //GRT_HIERARCHICAL_CLUSTERING_HEADER
virtual bool loadModelFromFile(std::fstream &file)
virtual bool saveModelToFile(std::fstream &file) const
virtual ~HierarchicalClustering()
virtual bool train_(MatrixFloat &trainingData)
virtual bool saveModelToFile(std::string filename) const
virtual bool loadModelFromFile(std::string filename)
virtual bool deepCopyFrom(const Clusterer *clusterer)
HierarchicalClustering & operator=(const HierarchicalClustering &rhs)