diff --git a/lib/matrix.gi b/lib/matrix.gi index 0c9595339c..7e3c7e7523 100644 --- a/lib/matrix.gi +++ b/lib/matrix.gi @@ -2949,6 +2949,9 @@ local m; return m; end); +InstallOtherMethod( TriangulizedMat, "for an empty list", [ IsList and IsEmpty ], +mat -> []); + ############################################################################# ## #M UpperSubdiagonal( , ) diff --git a/tst/testinstall/opers/TriangulizedMat.tst b/tst/testinstall/opers/TriangulizedMat.tst new file mode 100644 index 0000000000..bc2c613c95 --- /dev/null +++ b/tst/testinstall/opers/TriangulizedMat.tst @@ -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);