diff options
Diffstat (limited to 'a5/imatrix.h')
-rw-r--r-- | a5/imatrix.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/a5/imatrix.h b/a5/imatrix.h index f96cb0c..b13f60d 100644 --- a/a5/imatrix.h +++ b/a5/imatrix.h @@ -119,7 +119,7 @@ public: out.m(i,j) = 0; for(std::size_t k = 0; k < other.w; ++k) { - out.m(i,j) += m(i, j) * other.m(k, j); + out.m(i,j) += m(i,k) * other.m(k,j); } } } @@ -147,7 +147,7 @@ public: out.m(i,j) = 0; for(std::size_t k = 0; k < other.w; ++k) { - out.m(i,j) += m(i, j) / other.m(k, j); + out.m(i,j) += m(i,k) / other.m(k,j); } } } @@ -201,4 +201,6 @@ private: std::valarray<int> data; // default initialized to empty std::size_t w{}; // default initialized to 0 std::size_t h{}; // default initialized to 0 + + friend std::ostream& operator<<(std::ostream& s, const Imatrix& m); }; |