From b756b8c6489e2c32981c43121df40eb050050066 Mon Sep 17 00:00:00 2001 From: Thomas Rauh Desktop Date: Wed, 12 Nov 2025 22:47:37 +0100 Subject: [PATCH] matrix fertig --- matrix.c | 60 ++++++++++++++++++++++---------------------------------- 1 file changed, 23 insertions(+), 37 deletions(-) diff --git a/matrix.c b/matrix.c index edf17c8..60981b5 100644 --- a/matrix.c +++ b/matrix.c @@ -1,46 +1,10 @@ #include #include #include "matrix.h" +#include // TODO Matrix-Funktionen implementieren -/*Matrix createMatrix(unsigned int rows, unsigned int cols) { - Matrix matrix; - matrix.rows = rows; - matrix.cols = cols; - matrix.buffer = NULL; - - if(rows>0 && cols>0) { - matrix.buffer = (MatrixType **)malloc(rows * sizeof(MatrixType *)); // Speicher für Zeiger auf Zeilen - if(matrix.buffer == NULL) { - matrix.rows = 0; - matrix.cols = 0; - return matrix; - } - - for(int i=0;i0&&matrix2.cols==1)){ + output.rows = matrix1.rows; + output.cols = matrix1.cols; + output.buffer = malloc(sizeof(MatrixType)*output.rows*output.cols); + for (int i=0;i0)){ + output.rows = matrix2.rows; + output.cols = matrix2.cols; + output.buffer = malloc(sizeof(MatrixType)*output.rows*output.cols); + for (int i=0;i