@@ -72,7 +72,7 @@ function wilkinson(Hmm, t, d)
72
72
end
73
73
74
74
# 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
76
76
n = size (H, 1 )
77
77
istart = 1
78
78
iend = n
@@ -119,7 +119,7 @@ function _schur!(H::HessenbergFactorization{T}; tol = eps(T), debug = false, shi
119
119
Hm1m1 = HH[iend - 1 , iend - 1 ]
120
120
d = Hm1m1* Hmm - HH[iend, iend - 1 ]* HH[iend - 1 , iend]
121
121
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
123
123
debug && @printf (" block start is: %6d, block end is: %6d, d: %10.3e, t: %10.3e\n " , istart, iend, d, t)
124
124
125
125
if shiftmethod == :Francis
@@ -131,7 +131,7 @@ function _schur!(H::HessenbergFactorization{T}; tol = eps(T), debug = false, shi
131
131
debug && @printf (" Wilkinson-like shift! Subdiagonal is: %10.3e, last subdiagonal is: %10.3e\n " , HH[iend, iend - 1 ], HH[iend - 1 , iend - 2 ])
132
132
_d = t* t - 4 d
133
133
134
- if _d >= 0
134
+ if isreal (_d) && _d >= 0
135
135
# real eigenvalues
136
136
a = t/ 2
137
137
b = sqrt (_d)/ 2
@@ -247,10 +247,10 @@ LinearAlgebra.eigvals!(A::StridedMatrix; kwargs...) = _eigvals!(A; kwa
247
247
LinearAlgebra. eigvals! (H:: HessenbergMatrix ; kwargs... ) = _eigvals! (H, kwargs... )
248
248
LinearAlgebra. eigvals! (H:: HessenbergFactorization ; kwargs... ) = _eigvals! (H, kwargs... )
249
249
250
- function _eigvals! (S:: Schur{T} ; tol = eps (T )) where T
250
+ function _eigvals! (S:: Schur{T} ; tol = eps (real (T) )) where T
251
251
HH = S. data
252
252
n = size (HH, 1 )
253
- vals = Vector {Complex{T} } (undef, n)
253
+ vals = Vector {complex(T) } (undef, n)
254
254
i = 1
255
255
while i < n
256
256
Hii = HH[i, i]
0 commit comments