From f1bd72f40e964697511aa47a3279c1c28a80a3bc Mon Sep 17 00:00:00 2001 From: niklaskegelmann Date: Mon, 17 Nov 2025 12:07:46 +0100 Subject: [PATCH] Kommentare --- matrix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/matrix.c b/matrix.c index e4e8a08..69505ab 100644 --- a/matrix.c +++ b/matrix.c @@ -37,12 +37,12 @@ void clearMatrix(Matrix *matrix) } } -void setMatrixAt(MatrixType value, Matrix matrix, unsigned int rowIdx, unsigned int colIdx) +void setMatrixAt(MatrixType value, Matrix matrix, unsigned int rowIdx, unsigned int colIdx) //Values in matrix schreiben { matrix.buffer[(size_t)rowIdx * matrix.cols + colIdx] = value; } -MatrixType getMatrixAt(const Matrix matrix, unsigned int rowIdx, unsigned int colIdx) +MatrixType getMatrixAt(const Matrix matrix, unsigned int rowIdx, unsigned int colIdx) //aus matrix auslesen { if(rowIdx < matrix.rows && colIdx < matrix.cols){ return matrix.buffer[(size_t)rowIdx * matrix.cols + colIdx]; @@ -111,7 +111,7 @@ Matrix add(const Matrix matrix1, const Matrix matrix2) Matrix multiply(const Matrix matrix1, const Matrix matrix2) { - if (matrix1.cols != matrix2.rows) + if (matrix1.cols != matrix2.rows) //Spalten und Zeilen sind nicht gleich groß { Matrix result; result.rows = 0;