Some mutableMatrix updates - #4666
Open
d-torrance wants to merge 8 commits into
Open
Conversation
We return -1 when rank fails but never checked for it.
Prose, examples, keys, SeeAlso lists, and Subnodes lists are carried over
verbatim; rewrapped line breaks are the only change to running text.
A few slots that the old "document {...}" calls left empty are filled in,
since the SimpleDoc item syntax asks for a type: the Dense option is
documented as a Boolean, the ring and size arguments of the mutableMatrix
and mutableIdentity constructors get their types, the output of
mutableMatrix is typed MutableMatrix, and the unnamed permutation
argument of rowPermute and columnPermute (formerly "Nothing => ...") is
typed List.
In the MutableMatrix node, the row and column operations list is now a
SimpleDoc Tree, the idiomatic way to write a menu of links: its entries
carry headlines, and they remain plain TOH links rather than subnode
registrations, so they don't collide with the Subnodes list of the "row
and column operations" node. SimpleDoc renders a Tree heading as a
HEADER4, so the "matrix arithmetic" subheading was demoted from HEADER3
to HEADER4 to keep the node's two subheadings at the same level.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The six methods added in 94920c9 are documented by adding their keys to the existing mutableMatrix node, together with examples of the two forms: the ring inferred from the number or ring element, and the ring given explicitly. The list of classes accepted for the argument is extended to match the new keys. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Covers the methods added in 94920c9, except for (mutableMatrix, RingFamily, RingElement), which has no reachable arguments at present, as the elements of every ring family (RR, CC, RRi, CCi) are numbers rather than ring elements. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The engine has no rank routine for these, and before f3e5f9b the -1 it returned was passed along as the rank. Co-Authored-By: Claude Opus 5 <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.
A few semi-related things that all grew out of fixing the first thing:
Rank errors
According to
mutable-matrix.h:However, no such error message is given, and we just get -1!
So I added a little check in the interpreter -- if we get -1, return the last engine error instead, so now we have:
Constructor methods
While testing the above, I was sad that I had to type$1\times 1$ mutable matrix and wanted the
{{and}}' when constructing aNumber/RingElementconstructors we have for immutable matrices. So I'm proposing 6 new methods:There's also$p$ -adics to the engine).
mutableMatrix(RingFamily, RingElement), which won't do anything now except raise errors about promoting. But it might work in the future (e.g., after addingDocumentation updates
When I went to document the new constructor methods, I saw that a bunch of the mutable matrix docs were in the old format and in the poorly named
doc3.m2file. So I moved them and had Claude update them to SimpleDoc format.AfterPrintmethodWhile writing this pull request description, I realized that mutable matrices don't tell us the size or what ring we're working over like we get for immutable matrices. That's a great use for
AfterPrintmethods so we just use theMatrixone:🤖 AI Disclosure 🤖
I wrote the actual d and m2 code, but got lazy and had Claude do the boring stuff (documentation and tests) lol.