From f5739dd42be4c45e90565c1ff5f1115bc43d4f02 Mon Sep 17 00:00:00 2001 From: Al Date: Mon, 7 Dec 2015 18:10:04 -0500 Subject: [PATCH] [math] Signatures for array_exp and array_log --- src/vector_math.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vector_math.h b/src/vector_math.h index be10b8de..4990acd1 100644 --- a/src/vector_math.h +++ b/src/vector_math.h @@ -10,6 +10,10 @@ __VECTOR_BASE(name, type) \ __VECTOR_DESTROY(name, type) \ \ + static inline void type##_array_zero(type *array, size_t n) { \ + memset(array, 0, n * sizeof(type)); \ + } \ + \ static inline void type##_array_set(type *array, size_t n, type value) { \ for (int i = 0; i < n; i++) { \ array[i] = value; \ @@ -180,13 +184,13 @@ #define VECTOR_INIT_NUMERIC_FLOAT(name, type, type_abs) \ VECTOR_INIT_NUMERIC(name, type, type, type_abs) \ \ - static inline void type##_array_log(type *array, type c, size_t n) { \ + static inline void type##_array_log(type *array, size_t n) { \ for (int i = 0; i < n; i++) { \ array[i] = log(array[i]); \ } \ } \ \ - static inline void type##_array_exp(type *array, type c, size_t n) { \ + static inline void type##_array_exp(type *array, size_t n) { \ for (int i = 0; i < n; i++) { \ array[i] = exp(array[i]); \ } \