www.pudn.com > cluster_KM_DS.rar > Dbscan.h


// Dbscan.h: interface for the Dbscan class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#if !defined(AFX_DBSCAN_H__B74B4E88_D4D5_49D1_8299_C7A637818BB2__INCLUDED_) 
#define AFX_DBSCAN_H__B74B4E88_D4D5_49D1_8299_C7A637818BB2__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
#include "points.h" 
 
struct C_n 
{ 
	int i,  //searched  
		j,  //total 
		*Id; 
public: 
	C_n(int n) 
	{ 
		Id = new int [n]; 
		i = 1 ; 
		j = 0 ; 
	} 
	~C_n() 
	{ 
		delete []Id; 
	} 
}; 
class Dbscan   
{ 
public: 
	int N;  // the total number of the points 
	int **dis;  ///////////////// 
	int Eps, Minpts; 
	point *p; 
    int Class; 
	int *C; 
public: 
	Dbscan() ; 
	void set(int n,int Eps,int Minpts); 
	virtual ~Dbscan(); 
	long distance(point p1,point p2); 
	void init_dis(); 
	bool Core(int i); 
	int visit_next(); 
	void Db_scan(); 
 
}; 
 
#endif // !defined(AFX_DBSCAN_H__B74B4E88_D4D5_49D1_8299_C7A637818BB2__INCLUDED_)