change transpose signature

This commit is contained in:
2024-02-14 20:29:02 +01:00
parent 715bc843b2
commit b90195cac1
2 changed files with 4 additions and 4 deletions

View File

@@ -98,14 +98,14 @@ void Matrix::Load(const std::string& filename) {
}
}
Matrix Matrix::Transpose() const {
void Matrix::Transpose() {
Matrix result{m_Colonnes, m_Lignes};
for (std::size_t i = 0; i < m_Lignes; i++) {
for (std::size_t j = i; j < m_Colonnes; j++) {
for (std::size_t j = 0; j < m_Colonnes; j++) {
result.at(j, i) = at(i, j);
}
}
return result;
*this = result;
}
void Matrix::Identity() {

View File

@@ -36,7 +36,7 @@ class Matrix {
void Load(const std::string& filename);
Matrix Transpose() const;
void Transpose();
void Identity();