-
Notifications
You must be signed in to change notification settings - Fork 43
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
Account for pivoting in sparse Cholesky decompositions #175
Conversation
Test failures on Julia 1.6 seem to be caused by an upstream issue in ArrayLayouts: JuliaLinearAlgebra/ArrayLayouts.jl#161 |
Would it make sense to make an extra package for the |
Maybe, I'm not sure. It would require a breaking change though so it's also unclear whether/how quickly the package ecosystem would adopt the breaking release. In any case, I think this consideration is unrelated to the PR. The PR just fixes bugs in the current release of PDMats. |
Codecov ReportPatch coverage is
📢 Thoughts on this report? Let us know!. |
This PR is ready for review as well @andreasnoack 🙂 |
As explained in the docstring, one should be careful when working with Cholesky decompositions of sparse arrays since the property
:L
does not take into account the pivoting - in contrast to:PtL
which also includes the necessary permutations.This PR changes
chol_lower
andchol_upper
for such sparse Cholesky decompositions such that pivoting is taken into account. Unfortunately, since SparseArrays does not support multiplication of suchFactorComponent
s, code that multiplies the output ofchol_lower
/chol_upper
requires a different, explicitly constructed sparse equivalent of these factors. Alternatively, one could define internal functions for multiplying the output ofchol_lower
/chol_upper
, let them fall back to*
by default, and add special implementations for these sparse factors. I've not done this for now because I was not completely sure whether the sparse special case justifies such changes to the (internal) API.Additionally, the PR adds a seemingly missing definition of
chol_upper(::Matrix)
and fixes a few test errors in test/pdmtypes.jl and test/specialarrays.jl caused by upstream bugs.Fixes #120.
Edit: I suggest merging #180 first. That PR fixes the test issues on the master branch properly whereas this PR here only contains a workaround.