www.pudn.com > means.rar > myk-means.h, change:2007-02-11,size:457b


#ifndef _mykmeans_h_ 
#define _mykmeans_h_ 
 
#include<vector> 
#include<iostream> 
#include<string> 
#include<set> 
using namespace std; 
 
class kmeans 
{ 
public: 
	void initial(string fileName,int clusterNum); 
	void distribute(); 
	bool findNewCenter(); 
	void print(); 
private: 
	void getData(string fileName); 
	int findCloset(double t); 
	vector<double> data; 
	vector<double> center; 
	vector<set<double> > cluster; 
	int numOfCluster; 
}; 
#endif