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
:Ldoes not take into account the pivoting - in contrast to:PtLwhich also includes the necessary permutations.This PR changes
chol_lowerandchol_upperfor such sparse Cholesky decompositions such that pivoting is taken into account. Unfortunately, since SparseArrays does not support multiplication of suchFactorComponents, code that multiplies the output ofchol_lower/chol_upperrequires 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.