change transpose signature
This commit is contained in:
@@ -98,14 +98,14 @@ void Matrix::Load(const std::string& filename) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Matrix Matrix::Transpose() const {
|
void Matrix::Transpose() {
|
||||||
Matrix result{m_Colonnes, m_Lignes};
|
Matrix result{m_Colonnes, m_Lignes};
|
||||||
for (std::size_t i = 0; i < m_Lignes; i++) {
|
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);
|
result.at(j, i) = at(i, j);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
*this = result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Matrix::Identity() {
|
void Matrix::Identity() {
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class Matrix {
|
|||||||
|
|
||||||
void Load(const std::string& filename);
|
void Load(const std::string& filename);
|
||||||
|
|
||||||
Matrix Transpose() const;
|
void Transpose();
|
||||||
|
|
||||||
void Identity();
|
void Identity();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user