Pass a const matrix to sparseQR

This commit is contained in:
Desire NUENTSA 2013-01-11 17:47:32 +01:00
parent 33febdb48b
commit 121f3bdf04

View File

@ -79,13 +79,13 @@ class SparseQR
{ {
compute(mat); compute(mat);
} }
void compute(/*const*/ MatrixType& mat) void compute(const MatrixType& mat)
{ {
analyzePattern(mat); analyzePattern(mat);
factorize(mat); factorize(mat);
} }
void analyzePattern(const MatrixType& mat); void analyzePattern(const MatrixType& mat);
void factorize(/*const*/ MatrixType& mat); void factorize(const MatrixType& mat);
/** /**
* Get the number of rows of the triangular matrix. * Get the number of rows of the triangular matrix.
@ -223,7 +223,7 @@ void SparseQR<MatrixType,OrderingType>::analyzePattern(const MatrixType& mat)
* \param mat The sparse column-major matrix * \param mat The sparse column-major matrix
*/ */
template <typename MatrixType, typename OrderingType> template <typename MatrixType, typename OrderingType>
void SparseQR<MatrixType,OrderingType>::factorize(MatrixType& mat) void SparseQR<MatrixType,OrderingType>::factorize(const MatrixType& mat)
{ {
eigen_assert(m_analysisIsok && "analyzePattern() should be called before this step"); eigen_assert(m_analysisIsok && "analyzePattern() should be called before this step");
Index m = mat.rows(); Index m = mat.rows();