Skip to content

Commit

Permalink
Forward eigvals! calls with A::Matrix and B::Hermitian to A::Matrix a…
Browse files Browse the repository at this point in the history
…nd B::Matrix
  • Loading branch information
aravindh-krishnamoorthy committed Apr 29, 2023
1 parent 219dc10 commit efbeb98
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions stdlib/LinearAlgebra/src/symmetriceigen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,11 @@ function eigvals!(A::Hermitian{T,S}, B::Hermitian{T,S}; sortby::Union{Function,N
return vals
end
eigvecs(A::HermOrSym) = eigvecs(eigen(A))

# For A::StridedMatrix and B::Hermitian, a call to LAPACK is faster. See: https://github.com/JuliaLang/julia/issues/49533
function eigvals!(A::StridedMatrix{T}, B::HermOrSym{T,S}; sortby::Union{Function,Nothing}=nothing) where {T<:BlasReal,S<:StridedMatrix}
return eigvals!(A, Matrix{T}(B); sortby)
end
function eigvals!(A::StridedMatrix, B::Hermitian{T,S}; sortby::Union{Function,Nothing}=nothing) where {T<:BlasComplex,S<:StridedMatrix}
return eigvals!(A, Matrix{T}(B); sortby)
end

0 comments on commit efbeb98

Please sign in to comment.