Repository navigation
A 1x1 matrix has a rank and row echelon forms - #2272
Merged
Merged
Conversation
Rank, RowEchelonForm and ReducedRowEchelonForm threw InvalidCastException for every 1x1 matrix, and so did PointwiseMultiplication of two. A 1x1 matrix simplifies to its entry, and each cast the simplified matrix back to Matrix. OfTheShapeOf wraps the entry back for a 1x1 source only. A larger matrix simplifies to something that is not a matrix only where an entry has no value. That is #2270's NaN, and it still raises: wrapping it as a 1x1 matrix would give that matrix a rank of 1. OneByOneMatrixTest takes the rank and both forms of [2], [1/2], [-3] and [0], and a pointwise product. Five cases fail on master. The suite, the trio, F#, AOT and the eight harnesses pass. work/matrixcheck's 88 findings were all this. Fixes #2269. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2272 +/- ##
=======================================
Coverage 86.72% 86.72%
=======================================
Files 310 310
Lines 67833 67844 +11
Branches 19685 19690 +5
=======================================
+ Hits 58826 58838 +12
+ Misses 4890 4889 -1
Partials 4117 4117
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Rafael-SOWNet
added a commit
that referenced
this pull request
Oct 31, 2026
#2272 wraps both forms' simplified matrix in OfTheShapeOf, and this branch moves both to the Simple elimination; each form now does both. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
For a 1x1 matrix,
Rank,RowEchelonFormandReducedRowEchelonFormthrewInvalidCastException, and so didMathS.Matrices.PointwiseMultiplicationof two 1x1 matrices. A 1x1 matrix simplifies to its entry, and each cast the simplified result back toMatrix.Entity.Matrix.OfTheShapeOfwraps the entry back, but only when the source is 1x1. A larger matrix simplifies to something other than a matrix only when an entry has no value, as in #2270, and that case still throws: wrapping a NaN as a 1x1 matrix would give it a rank of 1.[[2]].Rank1[[2]].ReducedRowEchelonForm[1][[0]].Rank0PointwiseMultiplication([[2]], [[3]])[6]OneByOneMatrixTest: 5 of its cases fail on master. The suite (18,234), the trio, F#, AOT and the eight harnesses pass locally. All 88 findings inwork/matrixcheckwere this bug.Fixes #2269.
🤖 Generated with Claude Code