summaryrefslogtreecommitdiff
path: root/a5/imatrix.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2023-08-03 16:18:00 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2023-08-03 16:18:00 +0200
commit034a5fddfb292f22659f293d72ceb576f5c61d82 (patch)
tree80fb94e7f859ba81943132e2c02fa09946b9be0a /a5/imatrix.h
parentd4d7a3a372fa64d84a48e8f0a472349cbb67b4fb (diff)
A5: code complete
Diffstat (limited to 'a5/imatrix.h')
-rw-r--r--a5/imatrix.h6
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);
};