update 3
This commit is contained in:
parent
f5b255d0aa
commit
7475cf1cc2
1
matrix.c
1
matrix.c
@ -69,7 +69,6 @@ Matrix add(const Matrix matrix1, const Matrix matrix2)
|
||||
// add elements element-wise with broadcasting
|
||||
for (unsigned int row =0; row < resultRows; ++row){
|
||||
for (unsigned int col =0; col < resultCols; ++col){
|
||||
MatrixType val1 = getMatrixAt(matrix1, row, col);
|
||||
//Handle broadcasting: if matrix2 has 1 column, use column 0
|
||||
unsigned int col1 = (matrix1.cols ==1)? 0 : col;
|
||||
MatrixType val1 = getMatrixAt (matrix1, row, col1);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user