From 8b52d7f3170ae243e2652a42b77cde2a512f79bb Mon Sep 17 00:00:00 2001 From: = Date: Thu, 6 Nov 2025 17:04:40 +0100 Subject: [PATCH] started with matrix multiplication --- matrix.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/matrix.c b/matrix.c index f9b7942..6e32998 100644 --- a/matrix.c +++ b/matrix.c @@ -5,7 +5,8 @@ // TODO Matrix-Funktionen implementieren typedef struct Matrix { - + unsigned int xElement; + unsigned int yElement; } Matrix; Matrix createMatrix(unsigned int rows, unsigned int cols) @@ -33,7 +34,18 @@ Matrix add(const Matrix matrix1, const Matrix matrix2) } +//todo implement the content of the matrices Matrix multiply(const Matrix matrix1, const Matrix matrix2) { + //missing check for if the matrices can be multiplied + + // generate a new matrix wtih the correctr values: m1X, m2Y + for (int i = 0; i< matrix1.xElement; i++) { + for (int j = 0; j < matrix2.yElement; j++) { + for (int k = 0; k < matrix2.xElement; k++) { + //matrix[i][j] += matrix1[i][k] * matrix2[k][j]; + } + } + } } \ No newline at end of file