From: Ben Pfaff Date: Tue, 26 Apr 2011 02:56:42 +0000 (-0700) Subject: QUICK CLUSTER: Fold quick-cluster.h into quick-cluster.c. X-Git-Tag: v0.7.8~30 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5370b8123f10204aa716477fdeb8daa4e71af7d2;p=pspp-builds.git QUICK CLUSTER: Fold quick-cluster.h into quick-cluster.c. It's unusual to put 'static' function prototypes into a header file: header files are usually used to export declarations for use by other source files, but 'static' functions cannot be called outside their own source files. --- diff --git a/src/language/stats/automake.mk b/src/language/stats/automake.mk index b5312782..7b2022f0 100644 --- a/src/language/stats/automake.mk +++ b/src/language/stats/automake.mk @@ -38,7 +38,6 @@ language_stats_sources = \ src/language/stats/npar-summary.h \ src/language/stats/oneway.c \ src/language/stats/quick-cluster.c \ - src/language/stats/quick-cluster.h \ src/language/stats/reliability.c \ src/language/stats/roc.c \ src/language/stats/roc.h \ diff --git a/src/language/stats/quick-cluster.c b/src/language/stats/quick-cluster.c index 4dc3a2ff..f22658cd 100644 --- a/src/language/stats/quick-cluster.c +++ b/src/language/stats/quick-cluster.c @@ -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', diff --git a/src/language/stats/quick-cluster.h b/src/language/stats/quick-cluster.h deleted file mode 100644 index 9c7d1b90..00000000 --- a/src/language/stats/quick-cluster.h +++ /dev/null @@ -1,26 +0,0 @@ -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);