fix bug #294: add a diagonal() method to SparseMatrix (const)

This commit is contained in:
Gael Guennebaud
2011-12-04 21:49:21 +01:00
parent 69966e90e1
commit 82f9aa194d
3 changed files with 34 additions and 1 deletions

View File

@@ -398,7 +398,7 @@ public:
/** \returns the determinant of the underlying matrix from the current factorization */
Scalar determinant() const
{
Scalar detL = Diagonal<const CholMatrixType>(Base::m_matrix).prod();
Scalar detL = Base::m_matrix.diagonal().prod();
return internal::abs2(detL);
}
};