?? kmeans.h
字號:
#ifndef KMEANS_H_#define KMEANS_H_class KMeans{private: double** buffer; //double** optSolution; int number; int dimension; //data strure for accelerated k-means int* belongings; int* ranks; double* differences; double* quadPara; double* linearPara; double* constPara; int oldSmallCluster; int newSmallCluster; //statistics int naiveIterateTime; int boundIterateTime; int clusterTime; int iterateTime; int stopTime; //common functions double GetCost(double** centers, int k); double GetDistSqu(double* p1, double* p2); void OutputSolution(double** solution, int k); //original k-means algorithm functions double OneCluster(double** tempSolution, int k); int OneIterate(double** tempSolution, int k); //accelerated k-means algorithm functions double AccOneCluster(double** tempSolution, int k, double optCost); int AccIterate(double** tempSolution, int k, double optCost); double LowerBound(double currentCost, double lowerDelta, double upperDelta); void QuickSort(int left, int right); void swap(int* array, int left, int right);public: KMeans(double** buf, int num, int dim); ~KMeans(); //original k-mean algorithm void Cluster(double** optSolution, int k, int randomNum, int time); //accelerated k-means algorithm void AccCluster(double** optSolution, int k, int randomNum, int time);};#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -