Skip to content

Commit

Permalink
add missing method for eigvecs(A::HermOrSym) (#22453)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre authored and andreasnoack committed Jun 21, 2017
1 parent 2de5dab commit 15ee73a
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 @@ -480,6 +480,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 @@ -129,6 +129,7 @@ end
@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 15ee73a

Please sign in to comment.