aboutsummaryrefslogtreecommitdiff
path: root/km.h
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2019-02-04 11:18:30 -0500
committerPaul Duncan <pabs@pablotron.org>2019-02-04 11:18:30 -0500
commitf4a38b43d43f9395d6042d234a5e0ada7455ace1 (patch)
tree6357eac32d23a1fcaad5f4a8dd457a78f286855a /km.h
parent33e7c5bfdb9099e915876b8dbf6d3129459c2bc3 (diff)
downloadkmeans-f4a38b43d43f9395d6042d234a5e0ada7455ace1.tar.bz2
kmeans-f4a38b43d43f9395d6042d234a5e0ada7455ace1.zip
refactor random names
Diffstat (limited to 'km.h')
-rw-r--r--km.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/km.h b/km.h
index d8fe225..7858933 100644
--- a/km.h
+++ b/km.h
@@ -10,8 +10,8 @@ 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);
+ _Bool (*get_floats)(km_rand_t * const, const size_t, float * const);
+ _Bool (*get_sizes)(km_rand_t * const, const size_t, size_t * const);
void (*fini)(km_rand_t * const);
} km_rand_cbs_t;
@@ -22,16 +22,19 @@ struct km_rand_t_ {
};
// fill buffer with N random floats
-_Bool km_rand_fill(km_rand_t * const, const size_t, float * const);
+_Bool km_rand_get_floats(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);
+_Bool km_rand_get_sizes(km_rand_t * const, const size_t, size_t * const);
// finalize random source
void km_rand_fini(km_rand_t * const);
-// init system random source (uses system rand())
-void km_rand_init_system(km_rand_t *);
+// init libc random source (use libc rand())
+void km_rand_init_libc(km_rand_t *);
+
+// init random file source (e.g. "/dev/urandom")
+_Bool km_rand_init_path(km_rand_t * const, const char *);
// shape of data set
typedef struct {