less use of transpose
All checks were successful
Linux arm64 / Build (push) Successful in 1m26s

This commit is contained in:
2024-05-04 15:21:49 +02:00
parent 11cc0fadad
commit dc31f1f091
3 changed files with 33 additions and 11 deletions

View File

@@ -97,6 +97,25 @@ void Matrix::Augment(const Matrix& a_Right) {
*this = temp;
}
void Matrix::AugmentBottom(const Matrix& a_Bottom) {
assert(a_Bottom.m_Columns == m_Columns);
Matrix temp {m_Raws + a_Bottom.GetRawCount(), m_Columns};
for (std::size_t i = 0; i < m_Raws; i++) {
for (std::size_t j = 0; j < m_Columns; j++) {
temp.at(i, j) = at(i, j);
}
}
for (std::size_t i = 0; i < a_Bottom.GetRawCount(); i++) {
for (std::size_t j = 0; j < GetColumnCount(); j++) {
temp.at(i + GetRawCount(), j) = a_Bottom.at(i, j);
}
}
*this = temp;
}
Matrix Matrix::operator+(const Matrix& a_Other) const {
assert(GetColumnCount() == a_Other.GetColumnCount() && GetRawCount() == a_Other.GetRawCount());