/* ---- This file is NOT part of SECONDO. * Authors: Greg Hamerly and Jonathan Drake * Feedback: hamerly@cs.baylor.edu * See: http://cs.baylor.edu/~hamerly/software/kmeans.php * Copyright 2014 * * The SortKmeans algorithm is an implementation of Phillip's Sort-Means * algorithm. ---- //paragraph [1] Title: [{\Large \bf \begin{center}] [\end{center}}] //[TOC] [\tableofcontents] [1] Declarations for the SortKmeans algorithm 1 Declarations for the SortKmeans algorithm */ #ifndef SORT_KMEANS_H #define SORT_KMEANS_H /* Authors: Greg Hamerly and Jonathan Drake * Feedback: hamerly@cs.baylor.edu * See: http://cs.baylor.edu/~hamerly/software/kmeans.php * Copyright 2014 * * The SortKmeans algorithm is an implementation of Phillip's Sort-Means * algorithm. */ #include "original_space_kmeans.h" class SortKmeans : public OriginalSpaceKmeans { public: SortKmeans() : sortedCenters(NULL) {} virtual ~SortKmeans() { free(); } virtual void free(); virtual void initialize(Dataset const *aX, unsigned short aK, unsigned short *initialAssignment, int aNumThreads); virtual std::string getName() const { return "sort"; } private: virtual int runThread(int threadId, int maxIterations); void sort_centers(); // double is center-center distance squared, divided by 4; // short is center index std::pair *sortedCenters; }; #endif