Fix the column permutation in SparseQR

This commit is contained in:
Desire NUENTSA 2013-01-14 14:20:42 +01:00
parent a3b94d26c8
commit 904c2f137b
2 changed files with 4 additions and 4 deletions

View File

@ -20,7 +20,7 @@
*
*
*/
#include "OrderingMethods"
#include "src/SparseQR/SparseQR.h"
#include "src/Core/util/ReenableStupidWarnings.h"

View File

@ -235,12 +235,12 @@ void SparseQR<MatrixType,OrderingType>::factorize(const MatrixType& mat)
Index nzcolR, nzcolQ; // Number of nonzero for the current column of R and Q
Index pcol;
ScalarVector tval(m); tval.setZero(); // Temporary vector
IndexVector iperm(m);
IndexVector iperm(n);
bool found_diag;
if (m_perm_c.size())
for(int i = 0; i < m; i++) iperm(m_perm_c.indices()(i)) = i;
for(int i = 0; i < n; i++) iperm(m_perm_c.indices()(i)) = i;
else
iperm.setLinSpaced(m, 0, m-1);
iperm.setLinSpaced(n, 0, n-1);
// Left looking QR factorization : Compute a column of R and Q at a time
for (Index col = 0; col < n; col++)