This commit is contained in:
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user