MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / determinant

Method determinant

include/Eigen/src/SparseLU/SparseLU.h:449–464  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

447 * \sa absDeterminant(), logAbsDeterminant()
448 */
449 Scalar determinant() {
450 eigen_assert(m_factorizationIsOk && "The matrix should be factorized first.");
451 // Initialize with the determinant of the row matrix
452 Scalar det = Scalar(1.);
453 // Note that the diagonal blocks of U are stored in supernodes,
454 // which are available in the L part :)
455 for (Index j = 0; j < this->cols(); ++j) {
456 for (typename SCMatrix::InnerIterator it(m_Lstore, j); it; ++it) {
457 if (it.index() == j) {
458 det *= it.value();
459 break;
460 }
461 }
462 }
463 return (m_detPermR * m_detPermC) > 0 ? det : -det;
464 }
465
466 /** \brief Give the number of non zero in matrix L.
467 */

Callers 1

factorizeMethod · 0.45

Calls 3

colsMethod · 0.95
indexMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected