Add basic operations for row/column reductions in matrix objects#4517
Add basic operations for row/column reductions in matrix objects#4517fingolfin merged 24 commits intogap-system:masterfrom
Conversation
ThomasBreuer
left a comment
There was a problem hiding this comment.
I have left some comments
| # 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.
According to Codecov, this function is lacking tests
There was a problem hiding this comment.
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.
Tests for all functions have been added.
There was a problem hiding this comment.
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.
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.
The commit e334988 produced an error. Therefore, the old code of the "SwapMatrixRows" function is used again.
| mat[row1] := mat[row2]; | ||
| mat[row2] := temp; | ||
| mat{[row1,row2]} := mat{[row2,row1]}; | ||
|
|
There was a problem hiding this comment.
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.
This problem shows a bug in GAP, see issue #4533.
fingolfin
left a comment
There was a problem hiding this comment.
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 |
fingolfin
left a comment
There was a problem hiding this comment.
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