Repository navigation
Widen integer entries before abs in sparse opnorm - #1180
Merged
Merged
Conversation
`opnorm(A, 1)` and `opnorm(A, Inf)` added `abs` of each stored entry in the element type, where `abs(typemin(Int8)) == -128`. Take `norm` of the entry, as the dense `opnorm1` and `opnormInf` do, which converts to floating point first. Fixes #1177. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1180 +/- ##
=======================================
Coverage 98.97% 98.97%
=======================================
Files 16 16
Lines 10751 10751
=======================================
Hits 10641 10641
Misses 110 110 ☔ 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.
Fixes #1177.
opnorm(A, 1)andopnorm(A, Inf)losetypeminentries of a signed integer sparse matrix.Before
After
The column and row sums accumulate in floating point but added
absof each stored entry evaluated in the element type, andabs(typemin(Int8)) == -128. They now addnormof the entry, as the denseopnorm1andopnormInfdo, which converts to floating point before taking the absolute value; float and complex element types give the same values and result type as before. Them == 1andn == 1branches and thep = 2estimate already go throughnormof the stored values and were correct, andcondtakes its matrix norm from this function.Written by Claude Code.
🤖 Generated with Claude Code