main.cpp

来自「模式识别中的HCM算法」· C++ 代码 · 共 41 行

CPP
41
字号
#include<iostream>
#include<fstream>

#include "PR_HCM.h"
const int M = 6;
const int N = 5;


void main()
{
	/*double A[M][N] = //samples
	{
		{0,3,1,2,0},
		{1,3,0,1,0},
		{3,3,0,0,1},
		{1,1,0,2,0},
		{3,2,1,2,1},
		{4,1,1,1,0}
	};
	PR_HCM hcm(M);
	
	for(int i=0;i<M;i++)//initial the samples
	{
		for(int j=0;j<N;j++)
		{
			hcm.samples[i].unit.push_back(A[i][j]);
		}
	}*/


	std::ifstream fin("data.txt");
	if(!fin) return;

	PR_HCM hcm(fin);

	hcm.PrintSamples();
	hcm.Rend();
	hcm.PrintCluster();

	fin.close();
}

⌨️ 快捷键说明

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