mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-03-13 18:37:27 +08:00
fix bug in the computation of rank
very difficult to catch in unit-tests because this is very noisy
This commit is contained in:
parent
3134d5290b
commit
81cb887baf
@ -401,9 +401,11 @@ LU<MatrixType>::LU(const MatrixType& matrix)
|
||||
|
||||
m_det_pq = (number_of_transpositions%2) ? -1 : 1;
|
||||
|
||||
for(m_rank = 0; m_rank < size; ++m_rank)
|
||||
if(ei_isMuchSmallerThan(m_lu.diagonal().coeff(m_rank), m_lu.diagonal().coeff(0)))
|
||||
break;
|
||||
RealScalar biggest_diagonal_coeff = m_lu.diagonal().cwise().abs().maxCoeff();
|
||||
m_rank = 0;
|
||||
for(int k = 0; k < size; ++k)
|
||||
if(!ei_isMuchSmallerThan(m_lu.diagonal().coeff(k), biggest_diagonal_coeff))
|
||||
++m_rank;
|
||||
}
|
||||
|
||||
template<typename MatrixType>
|
||||
|
Loading…
x
Reference in New Issue
Block a user