📄 pr_cluster.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 + -