Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
c8b14cefae
@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user