aboutsummaryrefslogtreecommitdiff
path: root/vendor/libftm/src/mat/ftm_matsub.c
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/libftm/src/mat/ftm_matsub.c')
-rw-r--r--vendor/libftm/src/mat/ftm_matsub.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/vendor/libftm/src/mat/ftm_matsub.c b/vendor/libftm/src/mat/ftm_matsub.c
new file mode 100644
index 0000000..54ad900
--- /dev/null
+++ b/vendor/libftm/src/mat/ftm_matsub.c
@@ -0,0 +1,30 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ftm_matsub.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/05/11 12:56:00 by charles #+# #+# */
+/* Updated: 2020/05/11 13:06:43 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "libftm_mat.h"
+
+t_ftmmat *ftm_matsub(t_ftmmat *dst, t_ftmmat *other)
+{
+ size_t i;
+ size_t size;
+
+ if (dst->shape.x != other->shape.x || dst->shape.y != other->shape.y)
+ return (NULL);
+ size = dst->shape.x * dst->shape.y;
+ i = 0;
+ while (i < size)
+ {
+ dst->m[i] -= other->m[i];
+ i++;
+ }
+ return (dst);
+}