From 904c2f137b42f8d6df6d2e309c6a57b5727a7ae7 Mon Sep 17 00:00:00 2001 From: Desire NUENTSA Date: Mon, 14 Jan 2013 14:20:42 +0100 Subject: Fix the column permutation in SparseQR --- Eigen/src/SparseQR/SparseQR.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Eigen/src/SparseQR') diff --git a/Eigen/src/SparseQR/SparseQR.h b/Eigen/src/SparseQR/SparseQR.h index d78d5436d..c1348b320 100644 --- a/Eigen/src/SparseQR/SparseQR.h +++ b/Eigen/src/SparseQR/SparseQR.h @@ -235,12 +235,12 @@ void SparseQR::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++) -- cgit v1.2.3