alg.h

来自「分级聚类算法」· C头文件 代码 · 共 31 行

H
31
字号
//#include "stdafx.h"
#include <vector>
#include <CMath>

#if   _MSC_VER   >   1000   
#pragma   once   
#endif   //   _MSC_VER   >   1000   

#if   _MSC_VER   >   1020       //   if   VC++   version   is   >   4.2   
using   namespace   std;     //   std   c++   libs   implemented   in   std   
#endif

typedef vector<CPoint> PNTVECTOR;
typedef vector<PNTVECTOR> VECTORLIST;
//vector<VECTORLIST> pnts;

inline int GetDis(CPoint a, CPoint b)
{
	return sqrt((a.x - b.x)*(a.x - b.x)+(a.y - b.y)*(a.y - b.y));
}

inline CPoint GetCenter(CPoint a, CPoint &b)
{
	CPoint rt;
	rt.x=(a.x + b.x)/2;
	rt.y=(a.y + b.y)/2;
	return rt;
}

BOOL GradeCluser(VECTORLIST &pnts, int n);

⌨️ 快捷键说明

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