mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-02 18:20:38 +08:00
Fix indentation
This commit is contained in:
parent
c06e373beb
commit
1c61e28b32
@ -253,7 +253,7 @@ class SparseLU : public internal::SparseLUImpl<typename _MatrixType::Scalar, typ
|
|||||||
*
|
*
|
||||||
* \sa logAbsDeterminant(), signDeterminant()
|
* \sa logAbsDeterminant(), signDeterminant()
|
||||||
*/
|
*/
|
||||||
Scalar absDeterminant()
|
Scalar absDeterminant()
|
||||||
{
|
{
|
||||||
using std::abs;
|
using std::abs;
|
||||||
eigen_assert(m_factorizationIsOk && "The matrix should be factorized first.");
|
eigen_assert(m_factorizationIsOk && "The matrix should be factorized first.");
|
||||||
@ -272,49 +272,49 @@ class SparseLU : public internal::SparseLUImpl<typename _MatrixType::Scalar, typ
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return det;
|
return det;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \returns the natural log of the absolute value of the determinant of the matrix
|
/** \returns the natural log of the absolute value of the determinant of the matrix
|
||||||
* of which **this is the QR decomposition
|
* of which **this is the QR decomposition
|
||||||
*
|
*
|
||||||
* \note This method is useful to work around the risk of overflow/underflow that's
|
* \note This method is useful to work around the risk of overflow/underflow that's
|
||||||
* inherent to the determinant computation.
|
* inherent to the determinant computation.
|
||||||
*
|
*
|
||||||
* \sa absDeterminant(), signDeterminant()
|
* \sa absDeterminant(), signDeterminant()
|
||||||
*/
|
*/
|
||||||
Scalar logAbsDeterminant() const
|
Scalar logAbsDeterminant() const
|
||||||
{
|
{
|
||||||
using std::log;
|
using std::log;
|
||||||
using std::abs;
|
using std::abs;
|
||||||
|
|
||||||
eigen_assert(m_factorizationIsOk && "The matrix should be factorized first.");
|
|
||||||
Scalar det = Scalar(0.);
|
|
||||||
for (Index j = 0; j < this->cols(); ++j)
|
|
||||||
{
|
|
||||||
for (typename SCMatrix::InnerIterator it(m_Lstore, j); it; ++it)
|
|
||||||
{
|
|
||||||
if(it.row() < j) continue;
|
|
||||||
if(it.row() == j)
|
|
||||||
{
|
|
||||||
det += log(abs(it.value()));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return det;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** \returns A number representing the sign of the determinant
|
eigen_assert(m_factorizationIsOk && "The matrix should be factorized first.");
|
||||||
*
|
Scalar det = Scalar(0.);
|
||||||
* \sa absDeterminant(), logAbsDeterminant()
|
for (Index j = 0; j < this->cols(); ++j)
|
||||||
*/
|
{
|
||||||
Scalar signDeterminant()
|
for (typename SCMatrix::InnerIterator it(m_Lstore, j); it; ++it)
|
||||||
{
|
{
|
||||||
eigen_assert(m_factorizationIsOk && "The matrix should be factorized first.");
|
if(it.row() < j) continue;
|
||||||
return Scalar(m_detPermR);
|
if(it.row() == j)
|
||||||
}
|
{
|
||||||
|
det += log(abs(it.value()));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return det;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** \returns A number representing the sign of the determinant
|
||||||
|
*
|
||||||
|
* \sa absDeterminant(), logAbsDeterminant()
|
||||||
|
*/
|
||||||
|
Scalar signDeterminant()
|
||||||
|
{
|
||||||
|
eigen_assert(m_factorizationIsOk && "The matrix should be factorized first.");
|
||||||
|
return Scalar(m_detPermR);
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Functions
|
// Functions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user