Fix bug #596 : Recover plain SparseMatrix from SparseQR matrixQ()

This commit is contained in:
Desire NUENTSA
2013-05-21 17:35:10 +02:00
parent bd7511fc36
commit cf939f154f
5 changed files with 112 additions and 28 deletions

View File

@@ -673,6 +673,14 @@ class SparseMatrix
m_data.swap(other.m_data);
}
/** Sets *this to the identity matrix */
inline void setIdentity()
{
eigen_assert(rows() == cols() && "ONLY FOR SQUARED MATRICES");
this->setZero();
for (int j = 0; j < rows(); j++)
this->insert(j,j) = Scalar(1.0);
}
inline SparseMatrix& operator=(const SparseMatrix& other)
{
if (other.isRValue())