QUICK CLUSTER: Fold quick-cluster.h into quick-cluster.c.
[pspp-builds.git] / src / language / stats / quick-cluster.c
index 4dc3a2ff5a923f82c94205bd55c42cd734d3e69a..f22658cd194012351e9cc488909276c1a4cd4808 100644 (file)
@@ -54,8 +54,6 @@
 #define _(msgid) gettext (msgid)
 #define N_(msgid) msgid
 
-#include "quick-cluster.h"
-
 /*
 Struct KMeans:
 Holds all of the information for the functions.
@@ -81,6 +79,32 @@ struct Kmeans
   const struct variable *wv;   //Weighting variable
 };
 
+static struct Kmeans *kmeans_create (struct casereader *cs,
+                                    const struct variable **variables,
+                                    int m, int ngroups, int maxiter);
+
+static void kmeans_randomize_centers (struct Kmeans *kmeans);
+
+static int kmeans_get_nearest_group (struct Kmeans *kmeans, struct ccase *c);
+
+static void kmeans_recalculate_centers (struct Kmeans *kmeans);
+
+static int
+kmeans_calculate_indexes_and_check_convergence (struct Kmeans *kmeans);
+
+static void kmeans_order_groups (struct Kmeans *kmeans);
+
+static void kmeans_cluster (struct Kmeans *kmeans);
+
+static void quick_cluster_show_centers (struct Kmeans *kmeans, bool initial);
+
+static void quick_cluster_show_number_cases (struct Kmeans *kmeans);
+
+static void quick_cluster_show_results (struct Kmeans *kmeans);
+
+int cmd_quick_cluster (struct lexer *lexer, struct dataset *ds);
+
+static void kmeans_destroy (struct Kmeans *kmeans);
 
 /*
 Creates and returns a struct of Kmeans with given casereader 'cs', parsed variables 'variables',