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));
|
return (b >= Scalar(0.0) ? ei_abs(a) : -ei_abs(a));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/** \internal */
|
/** \internal */
|
||||||
MatrixUType m_matU;
|
MatrixUType m_matU;
|
||||||
@ -254,11 +254,14 @@ void SVD<MatrixType>::compute(const MatrixType& matrix)
|
|||||||
if (g != Scalar(0.0))
|
if (g != Scalar(0.0))
|
||||||
{
|
{
|
||||||
g = Scalar(1.0)/g;
|
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));
|
for (j=l; j<n; j++)
|
||||||
f = (s/A(i,i))*g;
|
{
|
||||||
A.col(j).end(m-i) += f * A.col(i).end(m-i);
|
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;
|
A.col(i).end(m-i) *= g;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user