fix indexing
This commit is contained in:
parent
93257b1efc
commit
9b9167e810
@ -18,7 +18,7 @@ auto matrixMultCPU(const Matrix<T> &matA, const Matrix<T> &matB) {
|
||||
Matrix<T> res(matA.rows, matB.cols);
|
||||
for (std::uint32_t i = 0; i < res.rows; i++) {
|
||||
for (std::uint32_t j = 0; j < res.cols; j++) {
|
||||
auto &res_val = res(j, i) = 0;
|
||||
auto &res_val = res(i, j) = 0;
|
||||
for (std::uint32_t k = 0; k < matA.cols; k++) {
|
||||
res_val += matA(i, k) * matB(k, j);
|
||||
}
|
||||
@ -34,7 +34,7 @@ auto matrixMultTransposeCPU(const Matrix<T> &matA, const Matrix<T> &matB) {
|
||||
Matrix<T> res(matA.rows, matB.cols);
|
||||
for (std::uint32_t i = 0; i < res.rows; i++) {
|
||||
for (std::uint32_t j = 0; j < res.cols; j++) {
|
||||
auto &res_val = res(j, i) = 0;
|
||||
auto &res_val = res(i, j) = 0;
|
||||
for (std::uint32_t k = 0; k < matA.cols; k++) {
|
||||
res_val += matA(i, k) * matB_t(j, k);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user