@@ -72,7 +72,7 @@ function wilkinson(Hmm, t, d)
7272end
7373
7474# We currently absorb extra unsupported keywords in kwargs. These could e.g. be scale and permute. Do we want to check that these are false?
75- function _schur! (H:: HessenbergFactorization{T} ; tol = eps (T) , debug = false , shiftmethod = :Francis , maxiter = 100 * size (H, 1 ), kwargs... ) where T<: Real
75+ function _schur! (H:: HessenbergFactorization{T} ; tol = eps (real (T)) , debug = false , shiftmethod = :Francis , maxiter = 100 * size (H, 1 ), kwargs... ) where T
7676 n = size (H, 1 )
7777 istart = 1
7878 iend = n
@@ -119,7 +119,7 @@ function _schur!(H::HessenbergFactorization{T}; tol = eps(T), debug = false, shi
119119 Hm1m1 = HH[iend - 1 , iend - 1 ]
120120 d = Hm1m1* Hmm - HH[iend, iend - 1 ]* HH[iend - 1 , iend]
121121 t = Hm1m1 + Hmm
122- t = iszero (t) ? eps (one (t)) : t # introduce a small pertubation for zero shifts
122+ t = iszero (t) ? eps (real ( one (t) )) : t # introduce a small pertubation for zero shifts
123123 debug && @printf (" block start is: %6d, block end is: %6d, d: %10.3e, t: %10.3e\n " , istart, iend, d, t)
124124
125125 if shiftmethod == :Francis
@@ -131,7 +131,7 @@ function _schur!(H::HessenbergFactorization{T}; tol = eps(T), debug = false, shi
131131 debug && @printf (" Wilkinson-like shift! Subdiagonal is: %10.3e, last subdiagonal is: %10.3e\n " , HH[iend, iend - 1 ], HH[iend - 1 , iend - 2 ])
132132 _d = t* t - 4 d
133133
134- if _d >= 0
134+ if isreal (_d) && _d >= 0
135135 # real eigenvalues
136136 a = t/ 2
137137 b = sqrt (_d)/ 2
@@ -247,10 +247,10 @@ LinearAlgebra.eigvals!(A::StridedMatrix; kwargs...) = _eigvals!(A; kwa
247247LinearAlgebra. eigvals! (H:: HessenbergMatrix ; kwargs... ) = _eigvals! (H, kwargs... )
248248LinearAlgebra. eigvals! (H:: HessenbergFactorization ; kwargs... ) = _eigvals! (H, kwargs... )
249249
250- function _eigvals! (S:: Schur{T} ; tol = eps (T )) where T
250+ function _eigvals! (S:: Schur{T} ; tol = eps (real (T) )) where T
251251 HH = S. data
252252 n = size (HH, 1 )
253- vals = Vector {Complex{T} } (undef, n)
253+ vals = Vector {complex(T) } (undef, n)
254254 i = 1
255255 while i < n
256256 Hii = HH[i, i]
0 commit comments