Skip to content

Commit

Permalink
Fix TriangulizedMat([])
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Mar 12, 2018
1 parent 903cdfc commit 9d40b35
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/matrix.gi
Original file line number Diff line number Diff line change
Expand Up @@ -2949,6 +2949,9 @@ local m;
return m;
end);

InstallOtherMethod( TriangulizedMat, "for an empty list", [ IsList and IsEmpty ],
mat -> []);

#############################################################################
##
#M UpperSubdiagonal( <mat>, <pos> )
Expand Down
33 changes: 33 additions & 0 deletions tst/testinstall/opers/TriangulizedMat.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
gap> START_TEST("TriangulizedMat.tst");

#
gap> a:=[];;
gap> b:=TriangulizedMat(a);
[ ]
gap> a = [];
true
gap> IsIdenticalObj(a, b);
false

#
gap> a:=[[42]];;
gap> b:=TriangulizedMat(a);
[ [ 1 ] ]
gap> a = [[42]];
true

#
gap> a:=[[Z(7)]];;
gap> b:=TriangulizedMat(a);
[ [ Z(7)^0 ] ]
gap> a = [[Z(7)]];
true

#
gap> TriangulizedMat([[1,2],[3,4]]);
[ [ 1, 0 ], [ 0, 1 ] ]
gap> TriangulizedMat([[1,2],[3,6]]);
[ [ 1, 2 ], [ 0, 0 ] ]

#
gap> STOP_TEST("TriangulizedMat.tst", 1);

0 comments on commit 9d40b35

Please sign in to comment.