Skip to content

Commit f5ecd73

Browse files
committed
protect freqresp against loading GenericLinearAlgebra
GLA returns it's own Hessenberg struct that does not have Q, so loading GLA might break freqresp due to GLA doing type piracy :/
1 parent 1d81af0 commit f5ecd73

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/freqresp.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ _freq(w, te::Discrete) = cis(w*te.Ts)
4242
if sys.nx == 0 # Only D-matrix
4343
return PermutedDimsArray(repeat(T.(sys.D), 1, 1, length(w_vec)), (3,1,2))
4444
end
45-
local F
45+
local F, Q
4646
try
4747
F = hessenberg(sys.A)
48+
Q = Matrix(F.Q)
4849
catch e
4950
# For matrix types that do not have a hessenberg implementation, we call the standard version of freqresp.
5051
e isa MethodError && return freqresp_nohess(sys, w_vec)
5152
rethrow()
5253
end
53-
Q = Matrix(F.Q)
5454
A = F.H
5555
C = sys.C*Q
5656
B = Q\sys.B

0 commit comments

Comments
 (0)