Skip to content

Commit

Permalink
add missing method for eigvecs(A::HermOrSym) (#22453)
Browse files Browse the repository at this point in the history
(cherry picked from commit 15ee73a)
  • Loading branch information
fredrikekre authored and vtjnash committed Sep 14, 2017
1 parent 1fdaadc commit a8d1625
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions base/linalg/symmetric.jl
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,8 @@ eigvals!(A::HermOrSym{T,S}, B::HermOrSym{T,S}) where {T<:BlasReal,S<:StridedMatr
eigvals!(A::Hermitian{T,S}, B::Hermitian{T,S}) where {T<:BlasComplex,S<:StridedMatrix} =
LAPACK.sygvd!(1, 'N', A.uplo, A.data, B.uplo == A.uplo ? B.data : B.data')[1]

eigvecs(A::HermOrSym) = eigvecs(eigfact(A))

function svdvals!(A::RealHermSymComplexHerm)
vals = eigvals!(A)
for i = 1:length(vals)
Expand Down
1 change: 1 addition & 0 deletions test/linalg/symmetric.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ let n=10
@test eigvals(Hermitian(asym), 1:2) d[1:2]
@test eigvals(Hermitian(asym), d[1] - 1, (d[2] + d[3])/2) d[1:2]
@test full(eigfact(asym)) asym
@test eigvecs(Hermitian(asym)) eigvecs(asym)

# relation to svdvals
@test sum(sort(abs.(eigvals(Hermitian(asym))))) == sum(sort(svdvals(Hermitian(asym))))
Expand Down

0 comments on commit a8d1625

Please sign in to comment.