aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Jacobi
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-08-12 18:23:39 -0400
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-08-12 18:23:39 -0400
commit2b618a2c1631548b00af3fe923e9db76aca71825 (patch)
tree6cbe9347e5ba541c0f22346e376f96e1e2fce612 /Eigen/src/Jacobi
parent309d540d4a71527a4dba778dc5221b81fd18f540 (diff)
make jacobi SVD more robust after experimenting with very nasty matrices...
it turns out to be better to repeat the jacobi steps on a given (p,q) pair until it is diagonal to machine precision, before going to the next (p,q) pair. it's also an optimization as experiments show that in a majority of cases this allows to find out that the (p,q) pair is already diagonal to machine precision.
Diffstat (limited to 'Eigen/src/Jacobi')
-rw-r--r--Eigen/src/Jacobi/Jacobi.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Eigen/src/Jacobi/Jacobi.h b/Eigen/src/Jacobi/Jacobi.h
index 5866ac44f..48195c1ec 100644
--- a/Eigen/src/Jacobi/Jacobi.h
+++ b/Eigen/src/Jacobi/Jacobi.h
@@ -50,7 +50,7 @@ void MatrixBase<Derived>::applyJacobiOnTheRight(int p, int q, Scalar c, Scalar s
template<typename Scalar>
bool ei_makeJacobi(Scalar x, Scalar y, Scalar z, Scalar *c, Scalar *s)
{
- if(ei_abs(y) < ei_abs(z-x) * 0.5 * machine_epsilon<Scalar>())
+ if(ei_abs(y) <= ei_abs(z-x) * 0.5 * machine_epsilon<Scalar>())
{
*c = Scalar(1);
*s = Scalar(0);