From d86f5339b2033af792fa60176f8060938e9599ec Mon Sep 17 00:00:00 2001 From: Jitse Niesen Date: Fri, 26 Feb 2010 09:47:17 +0000 Subject: [PATCH 1/2] ComplexSchur: fix bug introduced in my previous commit. The value of c is actually used a few lines later. --- Eigen/src/Eigenvalues/ComplexSchur.h | 6 ++++-- 1 file 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::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); From c72a5074e681b6680378a2231a8c4270aa7f23db Mon Sep 17 00:00:00 2001 From: nerbonne Date: Fri, 26 Feb 2010 15:46:43 +0100 Subject: [PATCH 2/2] Fixed perf problems for vector subtraction: inlining wasn't always happening when necessary. --- Eigen/src/Core/Assign.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Eigen/src/Core/Assign.h b/Eigen/src/Core/Assign.h index 9440cebf1..f760b6f6a 100644 --- a/Eigen/src/Core/Assign.h +++ b/Eigen/src/Core/Assign.h @@ -406,7 +406,7 @@ struct ei_unaligned_assign_impl template struct ei_assign_impl { - inline static void run(Derived1 &dst, const Derived2 &src) + EIGEN_STRONG_INLINE static void run(Derived1 &dst, const Derived2 &src) { const int size = dst.size(); const int packetSize = ei_packet_traits::size;