Skip to content

Commit

Permalink
use MutableCopyMatrix not MutableCopyMat
Browse files Browse the repository at this point in the history
As suggested in the discussion of gap-system#5352,
`MutableCopyMat` is just an (obsolete) synonym of `MutableCopyMatrix`
and therefore `MutableCopyMat` should not be used in GAP library code.
  • Loading branch information
ThomasBreuer authored and fingolfin committed Feb 10, 2023
1 parent e94baa2 commit f25ff7b
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 19 deletions.
8 changes: 4 additions & 4 deletions grp/basicmat.gi
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ SylowSubgroupOfTorusOfNaturalGL := function( gl, pi, p )
gens := List( orbs, function( orb )
local k, mat;
k := Size(orb);
mat := MutableCopyMat( one );
mat := MutableCopyMatrix( one );
mat{orb}{orb} := CompanionMat( MinimalPolynomial( gfq, Z(q^k) ) )^( (q^k-1)/p^PadicValuation(q^k-1,p));
return ImmutableMatrix( gfq, mat, true );
end );
Expand Down Expand Up @@ -474,7 +474,7 @@ SylowSubgroupOfNaturalGL := function( gl, p )
then return List( GeneratorsOfGroup( syl1 ),
function( x )
local mat;
mat := MutableCopyMat( one );
mat := MutableCopyMatrix( one );
mat{part}{part} := x ;
return mat;
end );
Expand All @@ -483,13 +483,13 @@ SylowSubgroupOfNaturalGL := function( gl, p )
return Concatenation(
List( GeneratorsOfGroup( prm ), function( x )
local mat;
mat := MutableCopyMat( one );
mat := MutableCopyMatrix( one );
mat{part}{part} := KroneckerProduct( PermutationMat( x, Size( part )/2, GF( q ) ), One( syl2 ) );
return mat;
end ),
List( GeneratorsOfGroup( syl2 ), function( x )
local mat;
mat := MutableCopyMat( one );
mat := MutableCopyMatrix( one );
mat{part{[1..2]}}{part{[1..2]}} := x;
return mat;
end ) );
Expand Down
2 changes: 1 addition & 1 deletion hpcgap/lib/vec8bit.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ InstallMethodWithRandomSource( Randomize,
for i in [1..Length(v)] do v[i] := Random(rs,l); od;
return v;
end );
InstallMethod( MutableCopyMat, "for an 8bit matrix",
InstallMethod( MutableCopyMatrix, "for an 8bit matrix",
[ Is8BitMatrixRep ],
function( m )
local mm;
Expand Down
2 changes: 1 addition & 1 deletion hpcgap/lib/vecmat.gi
Original file line number Diff line number Diff line change
Expand Up @@ -2377,7 +2377,7 @@ InstallMethodWithRandomSource( Randomize,
return v;
end );

InstallMethod( MutableCopyMat, "for a gf2 matrix",
InstallMethod( MutableCopyMatrix, "for a gf2 matrix",
[ IsGF2MatrixRep ],
function( m )
local mm;
Expand Down
8 changes: 4 additions & 4 deletions lib/algmat.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ InstallGlobalFunction( FullMatrixFLMLOR, function( R, n )
A; # algebra, result

gens:= NullMat( n, n, R );
gens:= [ gens, MutableCopyMat( gens ) ];
gens:= [ gens, MutableCopyMatrix( gens ) ];
one:= One( R );

# Construct the generators.
Expand Down Expand Up @@ -1284,17 +1284,17 @@ InstallGlobalFunction( FullMatrixLieFLMLOR, function( F, n )
one:= One( F );


gen:= MutableCopyMat( null );
gen:= MutableCopyMatrix( null );
gen[1,1]:= one;
gens:= [ LieObject( gen ) ];

for i in [ 2 .. n ] do

gen:= MutableCopyMat( null );
gen:= MutableCopyMatrix( null );
gen[1,i]:= one;
Add( gens, LieObject( gen ) );

gen:= MutableCopyMat( null );
gen:= MutableCopyMatrix( null );
gen[i,1]:= one;
Add( gens, LieObject( gen ) );

Expand Down
4 changes: 2 additions & 2 deletions lib/matobjnz.gi
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ local fam;
end );


InstallMethod( MutableCopyMat, "for a zmodnz matrix",
InstallMethod( MutableCopyMatrix, "for a zmodnz matrix",
[ IsZmodnZMatrixRep ],
function( m )
local l,res;
Expand Down Expand Up @@ -1357,7 +1357,7 @@ InstallMethod( InverseSameMutability, "for a zmodnz matrix",

InstallMethod( RankMat, "for a zmodnz matrix", [ IsZmodnZMatrixRep ],
function( m )
m:=MutableCopyMat(m);
m:=MutableCopyMatrix(m);
m:=SemiEchelonMatDestructive(m);
if m<>fail then m:=Length(m.vectors);fi;
return m;
Expand Down
4 changes: 0 additions & 4 deletions lib/matrix.gd
Original file line number Diff line number Diff line change
Expand Up @@ -1529,10 +1529,6 @@ DeclareGlobalFunction( "IdentityMat" );
##
DeclareOperation( "MutableCopyMatrix", [ IsList ] );

#T for backwards compatibility,
#T but note that 'MutableCopyMat' was not documented
DeclareSynonym( "MutableCopyMat", MutableCopyMatrix );


#############################################################################
##
Expand Down
17 changes: 17 additions & 0 deletions lib/obsolete.gd
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,23 @@ DeclareSynonym( "FirstOp", First );
DeclareObsoleteSynonym( "RadicalGroup", "SolvableRadical" );


#############################################################################
##
#O MutableCopyMat( <mat> )
##
## Moved to obsoletes in February 2023.
##
## Still used in corelg, crisp, cryst, cubefree, cvec, fining, forms, genss,
## guava, hap, hapcryst, lpres, matricesforhomalg, modisom, polycyclic,
## recog, semigroups, smallsemi, sophus (02/2023)
##
## (We cannot use 'DeclareObsoleteSynonym' because the cvec package wants to
## install a method for 'MutableCopyMat', thus 'MutableCopyMat' must be an
## operation.)
##
DeclareSynonym( "MutableCopyMat", MutableCopyMatrix );


#############################################################################
##
## Not used in any redistributed package
Expand Down
2 changes: 1 addition & 1 deletion lib/vec8bit.gi
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ InstallMethodWithRandomSource( Randomize,
for i in [1..Length(v)] do v[i] := Random(rs,l); od;
return v;
end );
InstallMethod( MutableCopyMat, "for an 8bit matrix",
InstallMethod( MutableCopyMatrix, "for an 8bit matrix",
[ Is8BitMatrixRep ],
function( m )
local mm;
Expand Down
2 changes: 1 addition & 1 deletion lib/vecmat.gi
Original file line number Diff line number Diff line change
Expand Up @@ -2380,7 +2380,7 @@ InstallMethodWithRandomSource( Randomize,
return v;
end );

InstallMethod( MutableCopyMat, "for a gf2 matrix",
InstallMethod( MutableCopyMatrix, "for a gf2 matrix",
[ IsGF2MatrixRep ],
function( m )
local mm;
Expand Down
2 changes: 1 addition & 1 deletion tst/testbugfix/2005-08-26-t00100.tst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# 2005/08/26 (Max)
gap> IsOperation(MutableCopyMat);
gap> IsOperation(MutableCopyMatrix);
true

0 comments on commit f25ff7b

Please sign in to comment.