Skip to content

Commit

Permalink
Merge pull request #637 from JuliaControl/safefreqresp
Browse files Browse the repository at this point in the history
protect `freqresp` against loading GenericLinearAlgebra
  • Loading branch information
baggepinnen authored Feb 17, 2022
2 parents bb229ff + f5ecd73 commit 5abb72f
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

2 comments on commit 5abb72f

@baggepinnen
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/54810

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.12.2 -m "<description of version>" 5abb72fed68c97698bf8752142de63ae7e4f5785
git push origin v0.12.2

Please sign in to comment.