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

Method logAbsDeterminant

include/Eigen/src/SparseLU/SparseLU.h:399–415  ·  view source on GitHub ↗

\brief Give the natural log of the absolute determinant. * * \returns the natural log of the absolute value of the determinant of the matrix * of which **this is the QR decomposition * * \note This method is useful to work around the risk of overflow/underflow that's * inherent to the determinant computation. * * \sa absDeterminant(), signDeterminant() */

Source from the content-addressed store, hash-verified

397 * \sa absDeterminant(), signDeterminant()
398 */
399 Scalar logAbsDeterminant() const {
400 using std::abs;
401 using std::log;
402
403 eigen_assert(m_factorizationIsOk && "The matrix should be factorized first.");
404 Scalar det = Scalar(0.);
405 for (Index j = 0; j < this->cols(); ++j) {
406 for (typename SCMatrix::InnerIterator it(m_Lstore, j); it; ++it) {
407 if (it.row() < j) continue;
408 if (it.row() == j) {
409 det += log(abs(it.value()));
410 break;
411 }
412 }
413 }
414 return det;
415 }
416
417 /** \brief Give the sign of the determinant.
418 *

Callers

nothing calls this directly

Calls 5

colsMethod · 0.95
logFunction · 0.50
absFunction · 0.50
rowMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected