aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2016-10-12 22:39:33 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2016-10-12 22:39:33 +0200
commitf939c351cbfcb1007943fe6062503bc455b692e1 (patch)
tree760cdf302423565e78391e36b7c14e45cd3f6706 /Eigen/src/SPQRSupport/SuiteSparseQRSupport.h
parent091d373ee9eebff409e5e11a911acc0a4692b54a (diff)
Fix SPQR for rectangular matrices
Diffstat (limited to 'Eigen/src/SPQRSupport/SuiteSparseQRSupport.h')
-rw-r--r--Eigen/src/SPQRSupport/SuiteSparseQRSupport.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h b/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h
index d9c3113e7..953d57c9d 100644
--- a/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h
+++ b/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h
@@ -119,16 +119,16 @@ class SPQR : public SparseSolverBase<SPQR<_MatrixType> >
max2Norm = RealScalar(1);
pivotThreshold = 20 * (mat.rows() + mat.cols()) * max2Norm * NumTraits<RealScalar>::epsilon();
}
-
cholmod_sparse A;
A = viewAsCholmod(mat);
+ m_rows = matrix.rows();
Index col = matrix.cols();
m_rank = SuiteSparseQR<Scalar>(m_ordering, pivotThreshold, col, &A,
&m_cR, &m_E, &m_H, &m_HPinv, &m_HTau, &m_cc);
if (!m_cR)
{
- m_info = NumericalIssue;
+ m_info = NumericalIssue;
m_isInitialized = false;
return;
}
@@ -139,7 +139,7 @@ class SPQR : public SparseSolverBase<SPQR<_MatrixType> >
/**
* Get the number of rows of the input matrix and the Q matrix
*/
- inline Index rows() const {return m_cR->nrow; }
+ inline Index rows() const {return m_rows; }
/**
* Get the number of columns of the input matrix.
@@ -245,6 +245,7 @@ class SPQR : public SparseSolverBase<SPQR<_MatrixType> >
mutable Index m_rank; // The rank of the matrix
mutable cholmod_common m_cc; // Workspace and parameters
bool m_useDefaultThreshold; // Use default threshold
+ Index m_rows;
template<typename ,typename > friend struct SPQR_QProduct;
};