mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 15:27:34 +00:00
LibGfx: Add Matrix::operator+(Matrix const & other)
This commit is contained in:
parent
6aa82f8b0b
commit
95878688a7
1 changed files with 10 additions and 0 deletions
|
@ -84,6 +84,16 @@ public:
|
|||
return product;
|
||||
}
|
||||
|
||||
constexpr Matrix operator+(Matrix const& other) const
|
||||
{
|
||||
Matrix sum;
|
||||
for (size_t i = 0; i < N; ++i) {
|
||||
for (size_t j = 0; j < N; ++j)
|
||||
sum.m_elements[i][j] = m_elements[i][j] + other.m_elements[i][j];
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
constexpr Matrix operator/(T divisor) const
|
||||
{
|
||||
Matrix division;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue