fix indexing

This commit is contained in:
Max Lübke 2023-10-04 09:16:14 +02:00
parent 93257b1efc
commit 9b9167e810

View File

@ -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);
}