aboutsummaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'util.h')
-rw-r--r--util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/util.h b/util.h
index cef238c..fa54ce0 100644
--- a/util.h
+++ b/util.h
@@ -21,4 +21,12 @@
exit(EXIT_FAILURE); \
} while (0)
+static inline float
+km_score(
+ const float mean_distance,
+ const size_t num_empty
+) {
+ return 1.0 / (mean_distance + num_empty);
+}
+
#endif /* UTIL_H */