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

Method absDeterminant

include/Eigen/src/SparseLU/SparseLU.h:371–387  ·  view source on GitHub ↗

\brief Give the absolute value of the determinant. * * \returns the absolute value of the determinant of the matrix of which * *this is the QR decomposition. * * \warning a determinant can be very big or small, so for matrices * of large enough dimension, there is a risk of overflow/underflow. * One way to work around that is to use logAbsDeterminant() instead. * * \sa l

Source from the content-addressed store, hash-verified

369 * \sa logAbsDeterminant(), signDeterminant()
370 */
371 Scalar absDeterminant() {
372 using std::abs;
373 eigen_assert(m_factorizationIsOk && "The matrix should be factorized first.");
374 // Initialize with the determinant of the row matrix
375 Scalar det = Scalar(1.);
376 // Note that the diagonal blocks of U are stored in supernodes,
377 // which are available in the L part :)
378 for (Index j = 0; j < this->cols(); ++j) {
379 for (typename SCMatrix::InnerIterator it(m_Lstore, j); it; ++it) {
380 if (it.index() == j) {
381 det *= abs(it.value());
382 break;
383 }
384 }
385 }
386 return det;
387 }
388
389 /** \brief Give the natural log of the absolute determinant.
390 *

Callers

nothing calls this directly

Calls 4

colsMethod · 0.95
absFunction · 0.50
indexMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected