Repository navigation
Conversation
AASparseMatrix(Symmetric(S, uplo)) and AASparseMatrix(Hermitian(S, uplo)) store only that triangle, with the symmetric (Hermitian) attributes. factor(A) picks LDLT for a complex symmetric (not Hermitian) matrix stored as one triangle, as libSparse's LU does not read that storage correctly. Assisted-by: Claude Code:claude-opus-5-5
This was referenced Nov 14, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #232 +/- ##
==========================================
- Coverage 91.73% 91.69% -0.05%
==========================================
Files 11 11
Lines 4697 4720 +23
==========================================
+ Hits 4309 4328 +19
- Misses 388 392 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The constructor no longer tests the matrix for symmetric or triangular structure. Symmetric storage comes from Symmetric/Hermitian or the attributes. Like factorize, the SparseMatrixCSC conveniences (factor, solve, AAFactorization, refactor!) still test the matrix, and store a Hermitian (or real symmetric) one as its lower triangle for Cholesky, LDLT and :auto only, so LU and QR get the full storage. Breaking, so the version is 0.9.0. Assisted-by: Claude Code:claude-opus-5-5
Symmetric/Hermitian, no structure detection in AASparseMatrix
This was referenced Nov 15, 2026
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.
Breaking, so the version is bumped to 0.9.0. Based on master, independent of the other open sparse PRs. It touches the same
factor!code and the end oftest/sparse_tests.jlas #229 and #231, so whichever merges second needs a small rebase; the conflicts are mechanical, and merged with #231 (and so the whole #228 → #230 → #231 stack) the sparse tests pass (1335/1335) and the docs build.Symmetric and Hermitian matrices from one triangle
AASparseMatrix(Symmetric(S, :L))(or:U, orHermitian) stores only that triangle, with the symmetric (Hermitian) attributes, as libSparse expects for Cholesky and LDLᵀ. It doesn't test the matrix for symmetry, so a lower triangle can be wrapped as is, in one copy. Until now, this needed the undocumentedATT_*flags.Symmetric, the other triangle of the parent is ignored.Hermitian, so is the imaginary part of the diagonal. Otherwise multiplication would use it while the factorization ignored it.AASparseMatrix(::SparseMatrixCSC).factor(A)picks LDLᵀ for a complex symmetric (not Hermitian) matrix stored as one triangle. Until now it picked LU, which libSparse computes incorrectly on that storage (#229).AASparseMatrix(::SparseMatrixCSC)stores the matrix as it isUntil now, the constructor tested every matrix (
ishermitian,istril,istriu), stored a symmetric (Hermitian) one as its lower triangle, and tagged a triangular one. In Julia, the structure comes from the type (Symmetric,Hermitian), and onlyfactorize-style functions test the values. The detection also:refactor!from one to the other failed;lu;Now the constructor stores the matrix as given, untagged unless
attributesare passed. Symmetric storage comes fromSymmetric/Hermitianor the attributes.The
SparseMatrixCSCconveniences (factor,solve,AAFactorization, andrefactor!) keep testing the matrix, likefactorize. They store a Hermitian (or real symmetric) matrix as its lower triangle only for the factorizations that use it: Cholesky, LDLᵀ, and:auto, which then picks Cholesky. LU and QR get the full storage, sofactor(S, :lu)on a symmetricSis now correct without #229.refactor!(f, S)storesSas the matrixfholds is stored.Code that relied on the detection, such as
cholesky(AASparseMatrix(S))for a symmetricS, now needscholesky(AASparseMatrix(Symmetric(S, :L))), orfactor(S, :cholesky). The docs say so in a compat note, and the docs examples and existing tests that relied on it are updated.Tests
The new tests cover:
Hermitian,Int32indices and element-type conversion, checked by round trip, by the stored values, by multiplication, and by solving;attributes;factor,solveandAAFactorizationfor aSparseMatrixCSC: one triangle for Cholesky, LDLᵀ and:auto, the full matrix for LU and QR;refactor!with aSparseMatrixCSCon both triangles and on LU;:auto) and LDLᵀ, and a non-real Hermitian diagonal;:auto, and through theSparseMatrixCSCconveniences, LU on the full storage for:autoand one triangle for:ldlt.