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

Method determinant

Eigen/src/SparseLU/SparseLU.h:337–356  ·  view source on GitHub ↗

\returns The determinant of the matrix. * * \sa absDeterminant(), logAbsDeterminant() */

Source from the content-addressed store, hash-verified

335 * \sa absDeterminant(), logAbsDeterminant()
336 */
337 Scalar determinant()
338 {
339 eigen_assert(m_factorizationIsOk && "The matrix should be factorized first.");
340 // Initialize with the determinant of the row matrix
341 Scalar det = Scalar(1.);
342 // Note that the diagonal blocks of U are stored in supernodes,
343 // which are available in the L part :)
344 for (Index j = 0; j < this->cols(); ++j)
345 {
346 for (typename SCMatrix::InnerIterator it(m_Lstore, j); it; ++it)
347 {
348 if(it.index() == j)
349 {
350 det *= it.value();
351 break;
352 }
353 }
354 }
355 return (m_detPermR * m_detPermC) > 0 ? det : -det;
356 }
357
358 protected:
359 // Functions

Callers 1

factorizeMethod · 0.45

Calls 3

colsMethod · 0.95
indexMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected