Skip to content

Commit

Permalink
protect freqresp against loading GenericLinearAlgebra
Browse files Browse the repository at this point in the history
GLA returns it's own Hessenberg struct that does not have Q, so loading GLA might break freqresp due to GLA doing type piracy :/
  • Loading branch information
baggepinnen committed Feb 17, 2022
1 parent 1d81af0 commit f5ecd73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/freqresp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ _freq(w, te::Discrete) = cis(w*te.Ts)
if sys.nx == 0 # Only D-matrix
return PermutedDimsArray(repeat(T.(sys.D), 1, 1, length(w_vec)), (3,1,2))
end
local F
local F, Q
try
F = hessenberg(sys.A)
Q = Matrix(F.Q)
catch e
# For matrix types that do not have a hessenberg implementation, we call the standard version of freqresp.
e isa MethodError && return freqresp_nohess(sys, w_vec)
rethrow()
end
Q = Matrix(F.Q)
A = F.H
C = sys.C*Q
B = Q\sys.B
Expand Down

0 comments on commit f5ecd73

Please sign in to comment.