aboutsummaryrefslogtreecommitdiff
path: root/km.h
diff options
context:
space:
mode:
Diffstat (limited to 'km.h')
-rw-r--r--km.h22
1 files changed, 14 insertions, 8 deletions
diff --git a/km.h b/km.h
index c70e13e..6f09009 100644
--- a/km.h
+++ b/km.h
@@ -5,6 +5,14 @@
#include <stdint.h> // uint8_t
#include <stdio.h> // FILE
+typedef enum {
+ KM_INIT_TYPE_RAND,
+ KM_INIT_TYPE_FORGY,
+ KM_INIT_TYPE_LAST,
+} km_init_type_t;
+
+km_init_type_t km_get_init_type(const char * const);
+
// forward typedef for callbacks
typedef struct km_rand_t_ km_rand_t;
@@ -77,21 +85,19 @@ _Bool km_set_normalize(km_set_t * const);
// get pointer to data set row
float *km_set_get_row(const km_set_t *, const size_t);
-// init a set with num_clusters clusters of shape num_floats by picking
-// random cluster centers
-_Bool km_set_init_rand_clusters(
+// init cluster set by picking random centroids
+_Bool km_init_rand(
km_set_t *,
const size_t,
const size_t,
km_rand_t *
);
-// init a set with num_clusters clusters of random points from the
-// given set
-_Bool km_set_init_rand_points(
+// init cluster set by picking random rows from set
+_Bool km_init_forgy(
km_set_t * const,
- const km_set_t * const,
const size_t,
+ const km_set_t * const,
km_rand_t *
);
@@ -134,8 +140,8 @@ typedef struct {
typedef _Bool (*km_find_init_cb_t)(
km_set_t * const cluster_set,
- const size_t num_floats,
const size_t num_clusters,
+ const km_set_t * const data_set,
void *cb_data
);