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

Method signDeterminant

include/Eigen/src/SparseLU/SparseLU.h:423–441  ·  view source on GitHub ↗

\brief Give the sign of the determinant. * * \returns A number representing the sign of the determinant * * \sa absDeterminant(), logAbsDeterminant() */

Source from the content-addressed store, hash-verified

421 * \sa absDeterminant(), logAbsDeterminant()
422 */
423 Scalar signDeterminant() {
424 eigen_assert(m_factorizationIsOk && "The matrix should be factorized first.");
425 // Initialize with the determinant of the row matrix
426 Index det = 1;
427 // Note that the diagonal blocks of U are stored in supernodes,
428 // which are available in the L part :)
429 for (Index j = 0; j < this->cols(); ++j) {
430 for (typename SCMatrix::InnerIterator it(m_Lstore, j); it; ++it) {
431 if (it.index() == j) {
432 if (it.value() < 0)
433 det = -det;
434 else if (it.value() == 0)
435 return 0;
436 break;
437 }
438 }
439 }
440 return det * m_detPermR * m_detPermC;
441 }
442
443 /** \brief Give the determinant.
444 *

Callers

nothing calls this directly

Calls 3

colsMethod · 0.95
indexMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected