mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-05-21 20:17:35 +08:00
fix bug in sorting of singular values
This commit is contained in:
parent
b10637be50
commit
5f8d58f36a
@ -393,8 +393,9 @@ void SVD<MatrixType>::compute(const MatrixType& matrix)
|
||||
{
|
||||
int k;
|
||||
W.end(n-i).minCoeff(&k);
|
||||
if (k != i)
|
||||
if (k != 0)
|
||||
{
|
||||
k += i;
|
||||
std::swap(W[k],W[i]);
|
||||
A.col(i).swap(A.col(k));
|
||||
V.col(i).swap(V.col(k));
|
||||
|
Loading…
x
Reference in New Issue
Block a user