Skip to content

Faster rankUpdate! method for HermitianRFP - #910

Open
dmbates wants to merge 3 commits into
mainfrom
db/FasterrankUpdate
Open

Faster rankUpdate! method for HermitianRFP#910
dmbates wants to merge 3 commits into
mainfrom
db/FasterrankUpdate

Conversation

@dmbates

@dmbates dmbates commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator
  • Rewrite the rankUpdate!(C::HermitianRFP{T}, A::SparseMatrixCSC{T}, ...) method to use A.colptr directly and avoid calls to nzrange(A, j) which just add another layer of indirection.
  • As part of this rewrite the levels of the second grouping factor are sorted by decreasing incidence when the reterm is generated. This concentrates more of the updates in the trapezoidal storage of C.data where linear indexing can be used.

@dmbates

dmbates commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator Author

We now have the peculiar situation that the rankUpdate! method for HermitianRFP is faster on some examples than that for HermOrSym. I believe the difference is from the sorting of levels of the second grouping factor which can concentrate the positions of the updates in the upper left part of C. (This is a heuristic, not a proof.)

Should we always sort the levels of the second grouping factor when A[2, 1] is SparseMatrixCSC and A[2, 2] is dense Hermitian?

@dmbates
dmbates requested a review from palday July 28, 2026 14:10
@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.59259% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.92%. Comparing base (117e05c) to head (7a62f0b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/linalg/rankUpdate.jl 92.59% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #910      +/-   ##
==========================================
- Coverage   95.69%   94.92%   -0.77%     
==========================================
  Files          38       38              
  Lines        3760     3921     +161     
==========================================
+ Hits         3598     3722     +124     
- Misses        162      199      +37     
Flag Coverage Δ
current 94.61% <92.59%> (-0.76%) ⬇️
minimum 94.82% <92.59%> (-0.77%) ⬇️
nightly 94.60% <92.59%> (-0.76%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant