-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add method to isposdef! for Hermitian and Symmetric #21561
Conversation
Instead of Edit: Nvm, I think this is not an issue. |
@KristofferC You probably concluded that already but |
test/linalg/symmetric.jl
Outdated
@@ -129,6 +129,12 @@ let n=10 | |||
@test det(a + a.') ≈ det(Symmetric(a + a.', :U)) | |||
@test det(a + a.') ≈ det(Symmetric(a + a.', :L)) | |||
|
|||
# isposdef | |||
if eltya != BigFloat # isposdef not defined for Matrix{BigFloat} | |||
@test isposdef(Symmetric(asym)) == isposdef(full(Symmetric(asym))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be good to directly test the methods for the mutating version, isposdef!
, that you've added here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guess we should test both.
Forgot to exclude |
base/linalg/symmetric.jl
Outdated
@@ -264,6 +264,8 @@ det(A::Symmetric) = det(bkfact(A)) | |||
inv{T<:BlasFloat,S<:StridedMatrix}(A::Hermitian{T,S}) = Hermitian{T,S}(inv(bkfact(A)), A.uplo) | |||
inv{T<:BlasFloat,S<:StridedMatrix}(A::Symmetric{T,S}) = Symmetric{T,S}(inv(bkfact(A)), A.uplo) | |||
|
|||
isposdef!(A::HermOrSym{<:BlasFloat, <:StridedMatrix}) = ishermitian(A) && LAPACK.potrf!(A.uplo, A.data)[2] == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extraneous space prior to <:StridedMatrix
?
dbc0338
to
530496e
Compare
Fix JuliaLang/LinearAlgebra.jl#422
Perhaps too late for 0.6, but here it is