Repository navigation
Conversation
AASparseMatrix stores a symmetric (Hermitian) SparseMatrixCSC as one triangle with the symmetric attributes. libSparse's LU factorizations do not read that storage correctly: factor(K, :lu) on a symmetric K, even a positive definite one, returned a factorization whose solutions are wrong (residual 1.5 on a 30x30 matrix, for :lu, LUSPP and LUUnpivoted alike), without any error. QR, Cholesky and LDLT are correct. An LU factorization of a matrix stored as one triangle now factorizes a copy with both triangles stored, and refactor!/lu! expand the new matrix the same way. Assisted-by: Claude Code:claude-opus-5-5
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #229 +/- ##
==========================================
+ Coverage 91.73% 91.75% +0.01%
==========================================
Files 11 11
Lines 4697 4706 +9
==========================================
+ Hits 4309 4318 +9
Misses 388 388 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Author
|
Should probably just get rid of the detection in |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AASparseMatrixstores a symmetric (Hermitian)SparseMatrixCSCas one triangle, with the symmetric attributes. libSparse's LU factorizations don't read that storage correctly, sofactor(K, :lu)on a symmetricKreturned a factorization with wrong solutions and no error:This includes positive definite matrices (residual 1.1 for a tridiagonal one) and
lu(AASparseMatrix(K)).An LU factorization of a matrix stored as one triangle now factorizes a copy with both triangles stored, and
refactor!andlu!expand the new matrix the same way.Tests
The tests cover real and complex Hermitian matrices, indefinite and positive definite:
:lu,LUSPPandLUUnpivotedthroughfactor;lu(::AASparseMatrix);refactor!andlu!;ATT_*attributes.They fail on master.
This PR is independent of the factorization-options stack (#228, #230, #231) and of #232 (symmetric matrices from one triangle). Whichever merges second needs a rebase: they change the same
factor!code and the end of the test file. The conflicts are mechanical; merged with #231 (and so the whole stack) the sparse tests pass (1262/1262), and so they do merged with #232 (1118/1118).