matrice augmenter
This commit is contained in:
@@ -136,6 +136,25 @@ bool Matrix::IsInversed() const {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Matrix::Augmenter(const Matrix& droite) {
|
||||||
|
assert(droite.m_Lignes == m_Lignes);
|
||||||
|
Matrix temp{m_Lignes, m_Colonnes + droite.m_Colonnes};
|
||||||
|
|
||||||
|
for (std::size_t i = 0; i < m_Lignes; i++) {
|
||||||
|
for (std::size_t j = 0; j < m_Colonnes; j++) {
|
||||||
|
temp.at(i, j) = at(i, j);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (std::size_t i = 0; i < m_Lignes; i++) {
|
||||||
|
for (std::size_t j = 0; j < droite.m_Colonnes; j++) {
|
||||||
|
temp.at(i, j + m_Colonnes) = droite.at(i, j);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
*this = temp;
|
||||||
|
}
|
||||||
|
|
||||||
bool Matrix::operator==(const Matrix& other) const {
|
bool Matrix::operator==(const Matrix& other) const {
|
||||||
if (m_Lignes != other.m_Lignes || m_Colonnes != other.m_Colonnes)
|
if (m_Lignes != other.m_Lignes || m_Colonnes != other.m_Colonnes)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ class Matrix {
|
|||||||
|
|
||||||
bool IsInversed() const;
|
bool IsInversed() const;
|
||||||
|
|
||||||
|
void Augmenter(const Matrix& droite);
|
||||||
|
|
||||||
Matrix SubMatrix(std::size_t origine_ligne, std::size_t origine_colonne, std::size_t ligne, std::size_t colonne) const;
|
Matrix SubMatrix(std::size_t origine_ligne, std::size_t origine_colonne, std::size_t ligne, std::size_t colonne) const;
|
||||||
|
|
||||||
bool operator==(const Matrix& other) const;
|
bool operator==(const Matrix& other) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user