MCPcopy Create free account
hub / github.com/XJTU-Graphics/dandelion / setIdentity

Method setIdentity

deps/Eigen/src/SparseCore/SparseMatrix.h:835–845  ·  view source on GitHub ↗

Sets *this to the identity matrix. * This function also turns the matrix into compressed mode, and drop any reserved memory. */

Source from the content-addressed store, hash-verified

833 /** Sets *this to the identity matrix.
834 * This function also turns the matrix into compressed mode, and drop any reserved memory. */
835 inline void setIdentity() {
836 eigen_assert(m_outerSize == m_innerSize && "ONLY FOR SQUARED MATRICES");
837 internal::conditional_aligned_delete_auto<StorageIndex, true>(m_innerNonZeros, m_outerSize);
838 m_innerNonZeros = 0;
839 m_data.resize(m_outerSize);
840 // is it necessary to squeeze?
841 m_data.squeeze();
842 std::iota(m_outerIndex, m_outerIndex + m_outerSize + 1, StorageIndex(0));
843 std::iota(innerIndexPtr(), innerIndexPtr() + m_outerSize, StorageIndex(0));
844 std::fill_n(valuePtr(), m_outerSize, Scalar(1));
845 }
846
847 inline SparseMatrix& operator=(const SparseMatrix& other) {
848 if (other.isRValue()) {

Callers 7

factorizeMethod · 0.45
runMethod · 0.45
runMethod · 0.45
runMethod · 0.45
runMethod · 0.45
runMethod · 0.45
JacobiSVD.hFile · 0.45

Calls 3

squeezeMethod · 0.80
fill_nFunction · 0.50
resizeMethod · 0.45

Tested by

no test coverage detected