mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix bug #596 : Recover plain SparseMatrix from SparseQR matrixQ()
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user