[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[quick-cluster 2/4] QUICK CLUSTER: Fold quick-cluster.h into quick-clust
From: |
Ben Pfaff |
Subject: |
[quick-cluster 2/4] QUICK CLUSTER: Fold quick-cluster.h into quick-cluster.c. |
Date: |
Mon, 25 Apr 2011 21:11:26 -0700 |
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.
---
src/language/stats/automake.mk | 1 -
src/language/stats/quick-cluster.c | 28 ++++++++++++++++++++++++++--
src/language/stats/quick-cluster.h | 26 --------------------------
3 files changed, 26 insertions(+), 29 deletions(-)
delete mode 100644 src/language/stats/quick-cluster.h
diff --git a/src/language/stats/automake.mk b/src/language/stats/automake.mk
index b531278..7b2022f 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 4dc3a2f..f22658c 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 9c7d1b9..0000000
--- 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);
--
1.7.2.5