aboutsummaryrefslogtreecommitdiff
path: root/km.h
diff options
context:
space:
mode:
Diffstat (limited to 'km.h')
-rw-r--r--km.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/km.h b/km.h
index 82bd835..c70e13e 100644
--- a/km.h
+++ b/km.h
@@ -11,6 +11,7 @@ typedef struct km_rand_t_ km_rand_t;
// random number source callbacks
typedef struct {
_Bool (*fill)(km_rand_t * const, const size_t, float * const);
+ _Bool (*fill_sizes)(km_rand_t * const, const size_t, size_t * const);
void (*fini)(km_rand_t * const);
} km_rand_cbs_t;
@@ -23,6 +24,9 @@ struct km_rand_t_ {
// fill buffer with N random floats
_Bool km_rand_fill(km_rand_t * const, const size_t, float * const);
+// fill buffer with N random size_ts
+_Bool km_rand_fill_sizes(km_rand_t * const, const size_t, size_t * const);
+
// finalize random source
void km_rand_fini(km_rand_t * const);
@@ -82,6 +86,15 @@ _Bool km_set_init_rand_clusters(
km_rand_t *
);
+// init a set with num_clusters clusters of random points from the
+// given set
+_Bool km_set_init_rand_points(
+ km_set_t * const,
+ const km_set_t * const,
+ const size_t,
+ km_rand_t *
+);
+
typedef struct {
float d2;
size_t cluster;