⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pr_isodata.h

📁 模式识别中的ISODATA算法 自己编写的
💻 H
字号:
#ifndef PR_ISODATA_H
#define PR_ISODATA_H


#include"PR_unit.h"

#include<fstream>
#include<string>
#include"PR_Cluster.h"

class DClusters
{
public:
	double d;
	int i;
	int j;
};

bool DijGreater( DClusters *d1,DClusters *d2);

class PR_ISODATA
{
public:
	vector< PR_unit* > samples;

	PR_ISODATA(){}
	PR_ISODATA(int m,int n);
	PR_ISODATA(std::ifstream &fin);
	
	//inner parameters;
	int K;								//the expect number of cluster 
	double SitaN;							//the least number samples in a cluster
	double SitaS;							//the Standard Deviation in a cluster
	double Sitac;							//the smallest distance of two clusters
	int L;								//the most number of clusters we can union at one time 
	int I;								//the most iterative number

	//
	int Nc;
	
	void PrintSamples();
	void SetPrameters();
	void PrintParameters();
	void PrintDelta();
	void PrintDeltaMax();
	void PrintD();
	void PrintDij();
	void Rend();						//start the algorithm
	void PrintClusters();				//print the result
	void PrintClusterCenter();			//print the center of the clusters

private:
	vector<PR_Cluster*> clusters;
	//int iter_number;					//the iterative number
	double D;							//the whole average distance
	double k;
	int num_samples;
	int num_vector;
	bool flag_split;
	
	vector<DClusters*> Dij;

	void AddSampleToCluster(int i,PR_Cluster* t_cluster);//add the i number sample to the cluster
	void DeleteCluster(int i);
	void AddCluster(PR_Cluster* t_cluster);
	void NearnestCluster();				//sort the samples to the nearest cluster
	void CancelaCluster();				//if the number of samples in a cluster is samller than SitaC ,then cancel the cluster
	void UpdateClusterCenter();			//update the center of clusters
	void CalcAverDis();					//calculate the average distance in each cluster
	void CalcWholeAverDis();
	void CalcSDVector();				//calculate the standard deviation distance vector in each cluster
	void CalcMaxComponent();
	void CalcWholeClusterDis();			//calculate the distance between clusters
	void SortDij();
	void SplitaCluster();
	void Unite2cluster();
	void Split();
	void Unite();
	
};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -