mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-11 11:19:02 +08:00
bugfix in SVD
This commit is contained in:
parent
4375c043ac
commit
a012aecbc4
@ -125,7 +125,7 @@ template<typename MatrixType> class SVD
|
||||
{
|
||||
return (b >= Scalar(0.0) ? ei_abs(a) : -ei_abs(a));
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
/** \internal */
|
||||
MatrixUType m_matU;
|
||||
@ -254,11 +254,14 @@ void SVD<MatrixType>::compute(const MatrixType& matrix)
|
||||
if (g != Scalar(0.0))
|
||||
{
|
||||
g = Scalar(1.0)/g;
|
||||
for (j=l; j<n; j++)
|
||||
if (m-l)
|
||||
{
|
||||
s = A.col(i).end(m-l).dot(A.col(j).end(m-l));
|
||||
f = (s/A(i,i))*g;
|
||||
A.col(j).end(m-i) += f * A.col(i).end(m-i);
|
||||
for (j=l; j<n; j++)
|
||||
{
|
||||
s = A.col(i).end(m-l).dot(A.col(j).end(m-l));
|
||||
f = (s/A(i,i))*g;
|
||||
A.col(j).end(m-i) += f * A.col(i).end(m-i);
|
||||
}
|
||||
}
|
||||
A.col(i).end(m-i) *= g;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user