started with matrix multiplication

This commit is contained in:
= 2025-11-06 17:04:40 +01:00
parent 9c6dac7822
commit 8b52d7f317

View File

@ -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];
}
}
}
}