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

📄 pr_cluster.h

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

#include"PR_unit.h"
using std::vector;

class PR_Cluster	//The cluster class
{
	public:
	vector< PR_unit* > samples;
	vector< int > serial;

	PR_unit* center;
	PR_unit* delta;		//the standard deviation distance vector
	double D;			//the average distance
	double deltamax;
	double num_max;

	PR_Cluster(){}
	PR_Cluster(int i):D(0)
	{
		center = new PR_unit(i,0);
		delta = new PR_unit(i,0);
	}
//	PR_Cluster(PR_unit unit);
	
	void CalcCenter();	//calculate the center of cluster
	void CalcAverDis();
	void CalcSDVector();// calculate the standard deviation distance vector
	void CalcMaxComponent(); // calculate the max component in the standard deviation distance vector
	void Print()
	{
		for(int i=0;i<serial.size();i++)
		{
			cout<<serial[i]+1<<"  ";
		}
	}
	void PrintCenter()
	{
		for(int i=0;i<center->unit.size();i++)
		{
			cout<<center->unit[i]<<"  ";
		}
	}
	void PrintDelta()
	{
		for(int i=0;i<delta->unit.size();i++)
		{
			cout<<delta->unit[i]<<"  ";
		}
	}
	void PrintDeltaMax()
	{
		cout<< deltamax << "  ";
	}
	void PrintD()
	{
		cout<< D << "  ";
	}
};

#endif

⌨️ 快捷键说明

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