MCPcopy Create free account
hub / github.com/PX4/eigen / setIdentity

Method setIdentity

Eigen/src/SparseCore/SparseMatrix.h:744–753  ·  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

742 /** Sets *this to the identity matrix.
743 * This function also turns the matrix into compressed mode, and drop any reserved memory. */
744 inline void setIdentity()
745 {
746 eigen_assert(rows() == cols() && "ONLY FOR SQUARED MATRICES");
747 this->m_data.resize(rows());
748 Eigen::Map<IndexVector>(this->m_data.indexPtr(), rows()).setLinSpaced(0, StorageIndex(rows()-1));
749 Eigen::Map<ScalarVector>(this->m_data.valuePtr(), rows()).setOnes();
750 Eigen::Map<IndexVector>(this->m_outerIndex, rows()+1).setLinSpaced(0, StorageIndex(rows()));
751 std::free(m_innerNonZeros);
752 m_innerNonZeros = 0;
753 }
754 inline SparseMatrix& operator=(const SparseMatrix& other)
755 {
756 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 5

indexPtrMethod · 0.80
rowsFunction · 0.50
colsFunction · 0.50
resizeMethod · 0.45
valuePtrMethod · 0.45

Tested by

no test coverage detected