Skip to content

Make generic cholesky throw on non-psd input#49417

Merged
dkarrasch merged 1 commit intomasterfrom
dk/generic_chol
Apr 21, 2023
Merged

Make generic cholesky throw on non-psd input#49417
dkarrasch merged 1 commit intomasterfrom
dk/generic_chol

Conversation

@dkarrasch
Copy link
Copy Markdown
Member

@dkarrasch dkarrasch added the linear algebra Linear algebra label Apr 19, 2023
Akk, info = _chol!(Akk, UpperTriangular)
if info != 0
return UpperTriangular(A), info
return UpperTriangular(A), convert(BlasInt, k)
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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