aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks/kmeans/lloyds_algorithm_util.h
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2020-06-12 13:19:18 +0100
committerYann Herklotz <git@yannherklotz.com>2020-06-12 13:19:18 +0100
commitda1b679c68c06ce1cf59df7706dcc59036872269 (patch)
tree37e2f899b717df444fd12cd5e6715b0de2aa69d2 /benchmarks/kmeans/lloyds_algorithm_util.h
parent0f9ab38389000edfa2376fabace69d2366d32647 (diff)
parent16da832b98deb028fe8248ed8ed29bfddb477124 (diff)
downloadvericert-kvx-da1b679c68c06ce1cf59df7706dcc59036872269.tar.gz
vericert-kvx-da1b679c68c06ce1cf59df7706dcc59036872269.zip
Merge branch 'master' of github.com:ymherklotz/CoqUp
Diffstat (limited to 'benchmarks/kmeans/lloyds_algorithm_util.h')
-rw-r--r--benchmarks/kmeans/lloyds_algorithm_util.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/benchmarks/kmeans/lloyds_algorithm_util.h b/benchmarks/kmeans/lloyds_algorithm_util.h
new file mode 100644
index 0000000..3853c3d
--- /dev/null
+++ b/benchmarks/kmeans/lloyds_algorithm_util.h
@@ -0,0 +1,33 @@
+/**********************************************************************
+* Felix Winterstein, Imperial College London
+*
+* File: lloyds_algorithm_util.h
+*
+* Revision 1.01
+* Additional Comments: distributed under a BSD license, see LICENSE.txt
+*
+**********************************************************************/
+
+#ifndef LLOYDS_ALGORITHM_UTIL_H
+#define LLOYDS_ALGORITHM_UTIL_H
+
+#include "lloyds_algorithm_top.h"
+
+
+// helper functions
+void set_coord_type_vector_item(coord_type_vector *a, const coord_type b, const uint idx);
+void set_coord_type_vector_ext_item(coord_type_vector_ext *a, const coord_type_ext b, const uint idx);
+coord_type get_coord_type_vector_item(const coord_type_vector a, const uint idx);
+coord_type_ext get_coord_type_vector_ext_item(const coord_type_vector_ext a, const uint idx);
+
+data_type conv_long_to_short(data_type_ext p);
+data_type_ext conv_short_to_long(data_type p);
+mul_input_type saturate_mul_input(coord_type_ext val);
+coord_type_ext fi_mul(coord_type_ext op1, coord_type_ext op2);
+coord_type_ext tree_adder(coord_type_ext *input_array);
+void tree_cs(coord_type_ext *input_array,centre_index_type *index_array,coord_type_ext *res_val,centre_index_type *res_idx,const uint m);
+coord_type_ext tree_adder(coord_type_ext *input_array,const uint m);
+void compute_distance(data_type p1, data_type p2, coord_type_ext *dist);
+
+
+#endif /* LLOYDS_ALGORITHM_UTIL_H */