mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-05-14 00:38:10 +08:00
fix a bug where some rotations were not initialized
They actually were in the original minpack code, this is a bug introduced by our migration. Reported on #322 and http://forum.kde.org/viewtopic.php?f=74&t=96197#p201158
This commit is contained in:
parent
5748d3c96f
commit
a660e6425c
@ -11,6 +11,7 @@ void r1updt(
|
|||||||
bool *sing)
|
bool *sing)
|
||||||
{
|
{
|
||||||
typedef DenseIndex Index;
|
typedef DenseIndex Index;
|
||||||
|
const JacobiRotation<Scalar> IdentityRotation = JacobiRotation<Scalar>(1,0);
|
||||||
|
|
||||||
/* Local variables */
|
/* Local variables */
|
||||||
const Index m = s.rows();
|
const Index m = s.rows();
|
||||||
@ -49,7 +50,8 @@ void r1updt(
|
|||||||
w[i] = givens.s() * s(j,i) + givens.c() * w[i];
|
w[i] = givens.s() * s(j,i) + givens.c() * w[i];
|
||||||
s(j,i) = temp;
|
s(j,i) = temp;
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
|
v_givens[j] = IdentityRotation;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* add the spike from the rank 1 update to w. */
|
/* add the spike from the rank 1 update to w. */
|
||||||
@ -73,7 +75,8 @@ void r1updt(
|
|||||||
/* store the information necessary to recover the */
|
/* store the information necessary to recover the */
|
||||||
/* givens rotation. */
|
/* givens rotation. */
|
||||||
w_givens[j] = givens;
|
w_givens[j] = givens;
|
||||||
}
|
} else
|
||||||
|
v_givens[j] = IdentityRotation;
|
||||||
|
|
||||||
/* test for zero diagonal elements in the output s. */
|
/* test for zero diagonal elements in the output s. */
|
||||||
if (s(j,j) == 0.) {
|
if (s(j,j) == 0.) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user