From c956594b3b9349a982fe4721b31de922b6cacd88 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Tue, 4 Oct 2022 09:50:04 -0400 Subject: operations sur des matrices --- matAdd.c | 30 ++++++++++++++++++++++++++++++ matMult.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 matAdd.c create mode 100644 matMult.c diff --git a/matAdd.c b/matAdd.c new file mode 100644 index 0000000..a6120c2 --- /dev/null +++ b/matAdd.c @@ -0,0 +1,30 @@ +/* matAdd.c + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * wrote this file. As long as you retain this notice + * you can do whatever you want with this stuff. If we meet some day, and you + * think this stuff is worth it, you can buy me a beer in return. + * Benjamin Chausse + * ---------------------------------------------------------------------------- + */ + +#include +#include "format.h" +#include "testData.h" + +int *matAdd(int *ma, int *mb, int w, int h){ + + int res[h][w]; + for (int i=0;i wrote this file. As long as you retain this notice + * you can do whatever you want with this stuff. If we meet some day, and you + * think this stuff is worth it, you can buy me a beer in return. + * Benjamin Chausse + * ---------------------------------------------------------------------------- + */ + +#include +#include "format.h" +#include "testData.h" + +int *matMult(int *ma, int *mb, int h1, int c, int w2){ + + int res[h1][w2]; + for (int i=0;i