Improve asymptotics - #50
Merged
Merged
Conversation
soft_symcover_min and soft_cover_min used :auto, which could select dense normal equations for sparse matrices. Give their sparse-storage methods the :lsqr default used by the hard minimal-cover solvers. The other soft AbsLog entry points delegate to these methods. Add Unitful disambiguation methods for allocating sparse minimal-cover calls. Without them, sparse quantity matrices lost unit-stripping dispatch and could fail at log(::Quantity). Assisted-by: Claude Fable 5 <noreply@anthropic.com>
Replace three full row-pair scans of W with foreach_support. Sparse weights now take O(nnz(W)) traversal instead of O(m^2 log m); dense behavior is unchanged. Count only stored nonzero summands when inflating for roundoff, since zero terms add no error. Assisted-by: Claude Fable 5 <noreply@anthropic.com>
boost_feasible_seq! repeatedly rescanned deferred pairs, taking Theta(D^2) when scales propagated against scan order. Queue pairs incident to each newly scaled vertex instead. Each vertex resolves once, reducing deferred resolution to O(D) and leaving the sort as the O(nnz log nnz) term. Pairs unreachable from a scaled endpoint retain the ordered equal-split fallback. Worklist order can change heuristic outputs when multiple neighbors could supply a scale, but every result remains feasible. Assisted-by: Claude Fable 5 <noreply@anthropic.com>
Outside sparse storage, :auto used dense normal equations whenever Woodbury was unavailable. Structured and wrapped sparse-support matrices could therefore incur O(N^2) memory and O(N^3) factorization costs. Select Woodbury when eligible, LSQR at support density <= 1/4, and dense solves otherwise. The choice depends on foreach_support rather than storage type. Results near the threshold may differ at solver tolerance. Assisted-by: Claude Fable 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #50 +/- ##
==========================================
+ Coverage 98.11% 98.39% +0.28%
==========================================
Files 13 13
Lines 2922 2937 +15
==========================================
+ Hits 2867 2890 +23
+ Misses 55 47 -8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Following #45, this fixes other cases that violated the hoped-for
O(nnz)ish performance.