Skip to content
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

Make generic cholesky throw on non-psd input #49417

Merged
merged 1 commit into from
Apr 21, 2023
Merged

Conversation

dkarrasch
Copy link
Member

@dkarrasch dkarrasch added the linear algebra Linear algebra label Apr 19, 2023
@@ -206,7 +206,7 @@ function _chol!(A::AbstractMatrix, ::Type{UpperTriangular})
A[k,k] = Akk
Akk, info = _chol!(Akk, UpperTriangular)
if info != 0
return UpperTriangular(A), info
return UpperTriangular(A), convert(BlasInt, k)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why k here instead of info? Same below

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought that the number (if nonzero) is supposed to indicate in which step/row/column the respective issue occurred, but I may have mixed that up with lu, and could reverse that here.

Copy link
Contributor

Choose a reason for hiding this comment

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

was just a curious / non-obvious change from what was previously there

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, this is what it says in lapack.jl within potrf!

#info[] > 0 means the leading minor of order info[] is not positive definite
#ordinarily, throw Exception here, but return error code here
#this simplifies isposdef! and factorize

@dkarrasch dkarrasch merged commit bb83df1 into master Apr 21, 2023
@dkarrasch dkarrasch deleted the dk/generic_chol branch April 21, 2023 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear algebra Linear algebra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cholesky on BigFloat accepts singular matrices
2 participants