Merge remote-tracking branch 'origin/main'

This commit is contained in:
Marike Berger 2025-11-10 15:28:45 +01:00
commit c8b14cefae
2 changed files with 3 additions and 3 deletions

View File

@ -61,8 +61,8 @@ Matrix add(const Matrix matrix1, const Matrix matrix2)
} }
Matrix result = createMatrix(matrix1.rows, matrix1.cols); Matrix result = createMatrix(matrix1.rows, matrix1.cols);
for (unsigned int i = 0; i < matrix1.rows; i++) { for (size_t i = 0; i < matrix1.rows; i++) {
for (unsigned int j = 0; j < matrix1.cols; j++) { for (size_t j = 0; j < matrix1.cols; j++) {
MatrixType sum = getMatrixAt(matrix1, i, j) + getMatrixAt(matrix2, i, j); MatrixType sum = getMatrixAt(matrix1, i, j) + getMatrixAt(matrix2, i, j);
setMatrixAt(sum, result, i, j); setMatrixAt(sum, result, i, j);
} }

View File

@ -4,9 +4,9 @@
#define UNDEFINED_MATRIX_VALUE 0 #define UNDEFINED_MATRIX_VALUE 0
typedef struct{ typedef struct{
float* buffer;
size_t rows; size_t rows;
size_t cols; size_t cols;
float* buffer;
} Matrix; } Matrix;