Author SHA1 Message Date
Mihaela Creciun e30fc66453 Multiply Funktion in matrix.c 2026-11-12 09:55:43 +01:00
Mihaela Creciun 5583ecd1ba Matrix-Struktur definieren 2026-11-12 01:46:53 +01:00
2 changed files with 5 additions and 1 deletions

No files matched your search

+4
View File
@@ -31,6 +31,10 @@ Matrix add(const Matrix matrix1, const Matrix matrix2)
Matrix multiply(const Matrix matrix1, const Matrix matrix2) Matrix multiply(const Matrix matrix1, const Matrix matrix2)
{ {
<<<<<<< Updated upstream
=======
>>>>>>> Stashed changes
// Überprüfen, ob die Matrizen gültig sind und ob ihre Dimensionen eine Multiplikation erlauben // Überprüfen, ob die Matrizen gültig sind und ob ihre Dimensionen eine Multiplikation erlauben
if (matrix1.buffer == NULL || matrix2.buffer == NULL || matrix1.cols != matrix2.rows) if (matrix1.buffer == NULL || matrix2.buffer == NULL || matrix1.cols != matrix2.rows)
{ {
+1 -1
View File
@@ -9,7 +9,7 @@ typedef float MatrixType;
typedef struct { typedef struct {
unsigned int rows; unsigned int rows;
unsigned int cols; unsigned int cols;
MatrixType *buffer; MatrixType *buffer; // Speichert die Matrixwerte in einem Array, die Speicheradresse des ersten Matrixwerts
} Matrix; } Matrix;