For example, I think you should write this: std::complex<Scalar> cc = cdiv<Scalar>(-ra,-sa,w,q); Instead of this: std::complex<Scalar> cc = cdiv(-ra,-sa,w,q); There is one place in the file where it is done correctly, other places where it is not. The reason is that if Scalar is a type that uses expression templates -ra is not necessarily the same type as w, so the type inference when invoking cdiv does not work correctly.
To be clear, I'm suggesting this patch: @@ -518,7 +518,7 @@ void EigenSolver<MatrixType>::doComputeEigenvectors() l = i; if (m_eivalues.coeff(i).imag() == RealScalar(0)) { - std::complex<Scalar> cc = cdiv(-ra,-sa,w,q); + std::complex<Scalar> cc = cdiv<Scalar>(-ra,-sa,w,q); m_matT.coeffRef(i,n-1) = internal::real(cc); m_matT.coeffRef(i,n) = internal::imag(cc); } @@ -532,7 +532,7 @@ void EigenSolver<MatrixType>::doComputeEigenvectors() if ((vr == 0.0) && (vi == 0.0)) vr = eps * norm * (internal::abs(w) + internal::abs(q) + internal::abs(x) + internal::abs(y) + internal::abs(lastw)); - std::complex<Scalar> cc = cdiv(x*lastra-lastw*ra+q*sa,x*lastsa-lastw*sa-q*ra,vr,vi); + std::complex<Scalar> cc = cdiv<Scalar>(x*lastra-lastw*ra+q*sa,x*lastsa-lastw*sa-q*ra,vr,vi); m_matT.coeffRef(i,n-1) = internal::real(cc); m_matT.coeffRef(i,n) = internal::imag(cc); if (internal::abs(x) > (internal::abs(lastw) + internal::abs(q))) @@ -542,7 +542,7 @@ void EigenSolver<MatrixType>::doComputeEigenvectors() } else { - cc = cdiv(-lastra-y*m_matT.coeff(i,n-1),-lastsa-y*m_matT.coeff(i,n),lastw,q); + cc = cdiv<Scalar>(-lastra-y*m_matT.coeff(i,n-1),-lastsa-y*m_matT.coeff(i,n),lastw,q); m_matT.coeffRef(i+1,n-1) = internal::real(cc); m_matT.coeffRef(i+1,n) = internal::imag(cc); }
-- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/636.