aboutsummaryrefslogtreecommitdiff
path: root/vendor/libftm/inc/libftm_mat.h
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-05-11 13:29:51 +0200
committerCharles <sircharlesaze@gmail.com>2020-05-11 13:29:51 +0200
commitd07d87964f13d3c1e6ad8c2f6d7db21101f1ef34 (patch)
tree52dd2e82580eb3c70201991b53a2a2b4c434908b /vendor/libftm/inc/libftm_mat.h
parent0700a8f567ab733a57fe688e45e5092d3fa1c1a0 (diff)
downloadscop-d07d87964f13d3c1e6ad8c2f6d7db21101f1ef34.tar.gz
scop-d07d87964f13d3c1e6ad8c2f6d7db21101f1ef34.tar.bz2
scop-d07d87964f13d3c1e6ad8c2f6d7db21101f1ef34.zip
libftm matrix, dynamic vector instead of fixed size
Diffstat (limited to 'vendor/libftm/inc/libftm_mat.h')
-rw-r--r--vendor/libftm/inc/libftm_mat.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/vendor/libftm/inc/libftm_mat.h b/vendor/libftm/inc/libftm_mat.h
new file mode 100644
index 0000000..63679bb
--- /dev/null
+++ b/vendor/libftm/inc/libftm_mat.h
@@ -0,0 +1,39 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* libftm_mat.h :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/05/11 12:50:40 by charles #+# #+# */
+/* Updated: 2020/05/11 13:28:55 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#ifndef LIBFTM_MAT_H
+# define LIBFTM_MAT_H
+
+# include <stddef.h>
+# include <stdlib.h>
+# include "libftm_vec.h"
+
+typedef struct s_ftmmat
+{
+ float *m;
+ struct
+ {
+ size_t x;
+ size_t y;
+ } shape;
+} t_ftmmat;
+
+t_ftmmat *ftm_matnew(size_t y, size_t x);
+void ftm_matdestroy(t_ftmmat *mat);
+t_ftmmat *ftm_matadd(t_ftmmat *dst, t_ftmmat *other);
+t_ftmmat *ftm_matsub(t_ftmmat *dst, t_ftmmat *other);
+t_ftmmat *ftm_matscale(t_ftmmat *dst, float scalar);
+t_ftmmat *ftm_matmul(t_ftmmat *dst, t_ftmmat *other);
+t_ftmvec *ftm_matmulvec(t_ftmmat *mat, t_ftmvec *dst);
+float ftm_matat(t_ftmmat *mat, size_t y, size_t x);
+
+#endif