-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add basic operations for row/column reductions in matrix objects #4517
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have left some comments
lib/matobj.gi
Outdated
# Checks | ||
if not( 0 < row and row <= NrRows(mat) ) then | ||
ErrorNoReturn("the second argument <row> has to fulfill 0 < row <= NrRows(mat) "); | ||
fi; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to Codecov, this function is lacking tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far, we have only written tests for SwapMatrixRows and SwapMatrixColumns. We plan to also write tests for all other functions that we added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests for all functions have been added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like GAP is always using the "IsRowListMatrix" functions. Is there a way to define a matrix object which is not a "RowListMatrix"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. In the end, this is what IsPlistMatrixRep
(or perhaps IsStrictPlistMatrixRep
) should do; see PR #2973 . It shouldn't be hard to do that atop the mentioned PR.
Co-authored-by: Max Horn <max@quendi.de>
Co-authored-by: Max Horn <max@quendi.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit e334988 produced an error. Therefore, the old code of the "SwapMatrixRows" function is used again.
lib/matobjplist.gi
Outdated
temp := mat[row1]; | ||
mat[row1] := mat[row2]; | ||
mat[row2] := temp; | ||
mat{[row1,row2]} := mat{[row2,row1]}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gives us an error:
Error, List Assignments: <rhss> must be a dense list (not a positional object) in
mat{[ row1, row2 ]} := mat{[ row2, row1 ]}; at .../GAP/gap/lib/matobjplist.gi:1351 called from
<function "SwapMatrixRows for a mutable IsRowListMatrix, one row number, second row number">( <arguments> )
called from read-eval loop at *stdin*:6
type 'quit;' to quit to outer loop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This problem shows a bug in GAP, see issue #4533.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is still marked as draft. What would you like to add before considering this ready for final review and merging?
At the moment some functions cannot be tested because we don't have a MatrixObj which is not a IsRowListMatrix. Everything else should be finished (A little bit disappointed because of the slow performance mentioned in #3962 ). |
The slow performance is only for |
PR #4557 may help! Once that's in, we could use it here (this actually motivated me to finally tackle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are a good start and should be merged; we can improve them later on, after all (better tests, performance tuning, using InstallEarlyMethod
, etc.)
Description
Closes #3962
Text for release notes
Implements elementary matrix operation for MatrixObjects