Skip to content

Commit

Permalink
fix a mutation/mutability problem in MTX.SubGModule
Browse files Browse the repository at this point in the history
addresses #5476
  • Loading branch information
ThomasBreuer committed Jul 25, 2023
1 parent aafd490 commit c7ea8e7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/meataxe.gi
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ SMTX.SpinnedBasis:=function( arg )
if IsList(v) and Length(v)=0 then
return [];
elif IsMatrix(v) then
TriangulizeMat(v);
v:= TriangulizedMat(v);
ans:=Filtered(v,x->not IsZero(x));
elif IsList(v) and IsVectorObj(v[1]) then
v:=TriangulizedMat(Matrix(F,v));
Expand Down
17 changes: 14 additions & 3 deletions tst/testinstall/meataxe.tst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#@local G,M,M2,M3,M4,M5,V,bf,bo,cf,homs,m,mat,qf,randM,res,sf,subs,mats,Q
#@local G,M,M2,M3,M4,M5,V,bf,bo,cf,homs,m,mat,qf,randM,res,sf,subs,mats,Q,orig,S
gap> START_TEST("meataxe.tst");

#
Expand Down Expand Up @@ -184,6 +184,17 @@ gap> Display(res[5]);
. . . . 1 .
. . . . . 1

#
gap> G:= SymmetricGroup(3);;
gap> M:= PermutationGModule( G, GF(2) );;
gap> mat:= [ [ 1, 1, 1 ], [ 0, 1, 1 ] ] * Z(2);;
gap> orig:= Immutable( mat );;
gap> S:= MTX.SubGModule( M, mat );;
gap> mat = orig; # the function call must not change the 2nd argument
true
gap> S = MTX.SubGModule( M, orig ); # 2nd argument may be immutable
true

#
# Tests for MTX.InvariantQuadraticForm and MTX.OrthogonalSign
# (the documentation is a bit unorthodox)
Expand Down Expand Up @@ -231,8 +242,8 @@ gap> Q:= MTX.InvariantQuadraticForm( m );
fail
gap> MTX.OrthogonalSign( m );
fail
gap> g:= SU(4, 3);;
gap> m:= GModuleByMats( GeneratorsOfGroup( g ), GF(9) );;
gap> G:= SU(4, 3);;
gap> m:= GModuleByMats( GeneratorsOfGroup( G ), GF(9) );;
gap> MTX.InvariantBilinearForm( m );
fail
gap> MTX.InvariantQuadraticForm( m );
Expand Down

0 comments on commit c7ea8e7

Please sign in to comment.