Skip to content
Snippets Groups Projects
Commit d14089c4 authored by Felix Gruber's avatar Felix Gruber
Browse files

[bugfix] fix Matrix::transpose()

Due to a confusion between the number of lines N and the number of
columns M, Matrix::transpose() gave wrong results for matrices with
N != M.
parent d0e5cad9
No related branches found
No related tags found
1 merge request!56Fix broken Matrix::transpose()
Pipeline #
......@@ -738,9 +738,9 @@ namespace MatrixImp
/** \brief Return the transpose of the matrix */
Matrix transpose() const {
Matrix out(N(), M());
for (size_type i=0; i<M(); i++)
for (size_type j=0; j<N(); j++)
Matrix out(M(), N());
for (size_type i=0; i<N(); i++)
for (size_type j=0; j<M(); j++)
out[j][i] = (*this)[i][j];
return out;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment