-
Notifications
You must be signed in to change notification settings - Fork 163
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
Fix IsMonomialMatrix for compressed matrices #3149
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3149 +/- ##
=======================================
Coverage 83.66% 83.66%
=======================================
Files 687 687
Lines 336685 336685
=======================================
Hits 281697 281697
Misses 54988 54988
|
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 would say the real bug in this situation is that BlistList
resp. the kernel function BLIST_LIST
runs into an error if the first argument is a compressed matrix, such as an element of SL(2,2)
.
Note that compressed matrices are in the filter IsList and IsDenseList
, thus calling BlistList
for such a matrix is allowed, according to the documentation.
I understand the proposed change as follows.
-
Using
BlistList
in the given situation --if it would work-- would be expensive and thus should be avoided. (It seems thatListWithIdenticalEntries( l, false )
is faster thanBlistList( l, [] )
, even for plain listsl
and even if one would additionally callConvertToBlistRep
; should the use ofBlistList
perhaps be deprecated, or restricted to specific situations?) -
The comment talks about the
IsMatrixObj
setup, which is not related to the code change. My interpretation is that a proper fix in this more general context will anyhow require more code changes.
In this sense, the proposed change can in principle be approved.
It would be good to address also what I had called the real bug above (in a separate pull request, without backport to GAP 4.10), perhaps by adjusting the documentation of BlistList
to the reality such that the first argument is restricted to certain types of lists.
Note that for MatrixObj implementations which are *not* lists, doing `for row in M do` may not work anymore (unless we decide to officially define that `Iterator(matobj)` shall return a row iterator).
548858a
to
6780172
Compare
I have no submitted a separate issue #3155 for the |
Backported to stable-4.10 via 18edc7f |
Note that for MatrixObj implementations which are not lists, doing
for row in M do
may not work anymore (unless we decide to officially define thatIterator(matobj)
shall return a row iterator).Fixes #3148
We could backport this, the change should be safe enough; but since this is an ancient bug, there is no urgent need to do it either.