Skip to content

Commit

Permalink
Fix IsMonomialMatrix for compressed matrices
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
fingolfin committed Dec 29, 2018
1 parent cf47710 commit 6780172
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/matrix.gi
Original file line number Diff line number Diff line change
Expand Up @@ -2574,7 +2574,7 @@ InstallMethod( IsMonomialMatrix,
if Length( M ) <> len then
return false;
fi;
found:= BlistList( M, [] );
found:= ListWithIdenticalEntries( len, false );
for row in M do
j := PositionNonZero( row );
if len < j or found[j] then
Expand Down
4 changes: 4 additions & 0 deletions tst/testbugfix/2018-12-28-IsMonomialMatrix.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
gap> Number(SL(2,2), IsMonomialMatrix);
2
gap> Number(SL(2,3), IsMonomialMatrix);
4

0 comments on commit 6780172

Please sign in to comment.