aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Jitse Niesen <jitse@maths.leeds.ac.uk>2010-02-26 09:47:17 +0000
committerGravatar Jitse Niesen <jitse@maths.leeds.ac.uk>2010-02-26 09:47:17 +0000
commitd86f5339b2033af792fa60176f8060938e9599ec (patch)
tree4a309c86e04e25a150e694f4eed42bb05b4a0b2c /Eigen
parent90e4a605ef920759a23cdbd24e6e7b69ce549162 (diff)
ComplexSchur: fix bug introduced in my previous commit.
The value of c is actually used a few lines later.
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/src/Eigenvalues/ComplexSchur.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/Eigen/src/Eigenvalues/ComplexSchur.h b/Eigen/src/Eigenvalues/ComplexSchur.h
index 0fad415a2..531ebf709 100644
--- a/Eigen/src/Eigenvalues/ComplexSchur.h
+++ b/Eigen/src/Eigenvalues/ComplexSchur.h
@@ -218,10 +218,12 @@ void ComplexSchur<MatrixType>::compute(const MatrixType& matrix, bool skipU)
sf = t.cwiseAbs().sum();
t /= sf; // the normalization by sf is to avoid under/overflow
- b = t.coeff(0,0) + t.coeff(1,1);
+ b = t.coeff(0,1) * t.coeff(1,0);
c = t.coeff(0,0) - t.coeff(1,1);
- disc = ei_sqrt(c*c + RealScalar(4)*t.coeff(0,1)*t.coeff(1,0));
+ disc = ei_sqrt(c*c + RealScalar(4)*b);
+ c = t.coeff(0,0) * t.coeff(1,1) - b;
+ b = t.coeff(0,0) + t.coeff(1,1);
r1 = (b+disc)/RealScalar(2);
r2 = (b-disc)/RealScalar(2);