From a068052f997073e82ee88285accc534fe69b5513 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 3 Sep 2025 10:00:26 +0200 Subject: [PATCH 1/5] Make IsMatrixGroup and IsFFEMatrixGroup more flexible --- lib/grpffmat.gd | 3 ++- lib/grpmat.gd | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/grpffmat.gd b/lib/grpffmat.gd index b3c626c3b1..cfac52c599 100644 --- a/lib/grpffmat.gd +++ b/lib/grpffmat.gd @@ -26,7 +26,8 @@ ## ## <#/GAPDoc> ## -DeclareSynonym( "IsFFEMatrixGroup", IsFFECollCollColl and IsMatrixGroup ); +DeclareCategory( "IsFFEMatrixGroup", IsMatrixGroup ); +InstallTrueMethod( IsFFEMatrixGroup, IsFFECollCollColl and IsMatrixGroup ); ############################################################################# diff --git a/lib/grpmat.gd b/lib/grpmat.gd index 8c9231140f..6c1a384ab1 100644 --- a/lib/grpmat.gd +++ b/lib/grpmat.gd @@ -26,7 +26,8 @@ ## ## <#/GAPDoc> ## -DeclareSynonym( "IsMatrixGroup", IsRingElementCollCollColl and IsGroup ); +DeclareCategory( "IsMatrixGroup", IsGroup ); +InstallTrueMethod( IsMatrixGroup, IsRingElementCollCollColl and IsGroup ); ############################################################################# ## From 7bcc95b173360d57a8425243f545c0655940d7b5 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 3 Sep 2025 10:00:55 +0200 Subject: [PATCH 2/5] Add a bunch of new filters for FFE and cylotomic matrices --- lib/matobj1.gd | 30 ++++++++++++++++++++++++++++++ lib/matobjplist.gd | 4 ---- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/lib/matobj1.gd b/lib/matobj1.gd index afc33a3d15..0532865648 100644 --- a/lib/matobj1.gd +++ b/lib/matobj1.gd @@ -263,6 +263,36 @@ DeclareCategory( "IsMatrixObj", IsMatrixOrMatrixObj ); DeclareCategory( "IsRowListMatrix", IsMatrixObj ); + +############################################################################# +## +# Two filters to speed up some methods: +DeclareFilter( "IsIntVector" ); # TODO: replace this legacy filter from matobjplist.gi with something better +DeclareFilter( "IsFFEVector" ); + +DeclareCategory( "IsFFEVectorObj", IsVectorObj ); +DeclareCategory( "IsCyclotomicVectorObj", IsVectorObj ); + +DeclareCategory( "IsFFEMatrixOrMatrixObj", IsMatrixOrMatrixObj ); +# DeclareSynonym( "IsFFEMatrix", IsFFEMatrixOrMatrixObj and IsMatrix ); +# DeclareSynonym( "IsFFEMatrixObj", IsFFEMatrixOrMatrixObj and IsMatrixObj ); +# or maybe +# DeclareProperty( "IsFFEMatrix", IsMatrix ); +# DeclareProperty( "IsFFEMatrixObj", IsMatrixObj ); + +DeclareCategory( "IsCyclotomicMatrixOrMatrixObj", IsMatrixOrMatrixObj ); +# DeclareSynonym( "IsCyclotomicMatrix", IsCyclotomicMatrixOrMatrixObj and IsMatrix ); +# DeclareSynonym( "IsCyclotomicMatrixObj", IsCyclotomicMatrixOrMatrixObj and IsMatrixObj ); +# or maybe have them be properties with methods so users are not confused ?!? +# DeclareProperty( "IsCyclotomicMatrix", IsMatrix ); +# DeclareProperty( "IsCyclotomicMatrixObj", IsMatrixObj ); + + +InstallTrueMethod( IsFFEMatrixOrMatrixObj, IsFFECollColl and IsMatrix ); +InstallTrueMethod( IsCyclotomicMatrixOrMatrixObj, IsCyclotomicCollColl and IsMatrix ); + + + ############################################################################# ## #A BaseDomain( ) diff --git a/lib/matobjplist.gd b/lib/matobjplist.gd index 5bcd6d38db..2c591f4829 100644 --- a/lib/matobjplist.gd +++ b/lib/matobjplist.gd @@ -122,7 +122,3 @@ BindGlobal( "ROWSPOS", 4 ); #BindGlobal( "BDPOS", 1 ); # see above BindGlobal( "ELSPOS", 2 ); -# Two filters to speed up some methods: -DeclareFilter( "IsIntVector" ); -DeclareFilter( "IsFFEVector" ); - From c549847b219bbc824ce004f2e0e97bf24b023c0e Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 4 Sep 2025 14:13:13 +0200 Subject: [PATCH 3/5] Widen declaration for many matrix related functions --- lib/matrix.gd | 68 +++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/lib/matrix.gd b/lib/matrix.gd index 210891dccd..6cc0a5bc2e 100644 --- a/lib/matrix.gd +++ b/lib/matrix.gd @@ -228,7 +228,7 @@ DeclareSynonym( "DiagonalOfMat", DiagonalOfMatrix ); ## ## <#/GAPDoc> ## -DeclareAttribute( "BaseMat", IsMatrix ); +DeclareAttribute( "BaseMat", IsMatrixOrMatrixObj ); ############################################################################# ## @@ -255,7 +255,7 @@ DeclareAttribute( "BaseMat", IsMatrix ); ## ## <#/GAPDoc> ## -DeclareOperation( "BaseMatDestructive", [ IsMatrix ] ); +DeclareOperation( "BaseMatDestructive", [ IsMatrixOrMatrixObj ] ); ############################################################################# ## @@ -277,7 +277,7 @@ DeclareOperation( "BaseMatDestructive", [ IsMatrix ] ); ## ## <#/GAPDoc> ## -DeclareAttribute( "BaseOrthogonalSpaceMat", IsMatrix ); +DeclareAttribute( "BaseOrthogonalSpaceMat", IsMatrixOrMatrixObj ); ############################################################################# @@ -304,7 +304,7 @@ DeclareAttribute( "BaseOrthogonalSpaceMat", IsMatrix ); ## ## <#/GAPDoc> ## -DeclareAttribute( "DefaultFieldOfMatrix", IsMatrix ); +DeclareAttribute( "DefaultFieldOfMatrix", IsMatrixOrMatrixObj ); ############################################################################# @@ -328,7 +328,7 @@ DeclareAttribute( "DefaultFieldOfMatrix", IsMatrix ); ## ## <#/GAPDoc> ## -DeclareAttribute( "DepthOfUpperTriangularMatrix", IsMatrix ); +DeclareAttribute( "DepthOfUpperTriangularMatrix", IsMatrixOrMatrixObj ); ############################################################################# @@ -435,7 +435,7 @@ DeclareSynonym( "DeterminantMatDivFree", DeterminantMatrixDivFree ); ## ## <#/GAPDoc> ## -DeclareAttribute( "DimensionsMat", IsMatrix ); +DeclareAttribute( "DimensionsMat", IsMatrixOrMatrixObj ); ############################################################################# @@ -482,7 +482,7 @@ DeclareAttribute( "DimensionsMat", IsMatrix ); ## ## <#/GAPDoc> ## -DeclareOperation( "ElementaryDivisorsMat", [IsRing,IsMatrix] ); +DeclareOperation( "ElementaryDivisorsMat", [IsRing, IsMatrixOrMatrixObj] ); DeclareGlobalFunction( "ElementaryDivisorsMatDestructive" ); ############################################################################# @@ -555,7 +555,7 @@ DeclareGlobalFunction( "ElementaryDivisorsMatDestructive" ); ## ## <#/GAPDoc> ## -DeclareOperation( "ElementaryDivisorsTransformationsMat", [IsRing,IsMatrix] ); +DeclareOperation( "ElementaryDivisorsTransformationsMat", [IsRing, IsMatrixOrMatrixObj] ); DeclareGlobalFunction( "ElementaryDivisorsTransformationsMatDestructive" ); ############################################################################# @@ -572,7 +572,7 @@ DeclareGlobalFunction( "ElementaryDivisorsTransformationsMatDestructive" ); ## ## ## -DeclareOperation( "TriangulizedNullspaceMatNT", [ IsMatrix ] ); +DeclareOperation( "TriangulizedNullspaceMatNT", [ IsMatrixOrMatrixObj ] ); ############################################################################# @@ -598,8 +598,8 @@ DeclareOperation( "TriangulizedNullspaceMatNT", [ IsMatrix ] ); ## ## <#/GAPDoc> ## -DeclareAttribute( "NullspaceMat", IsMatrix ); -DeclareAttribute( "TriangulizedNullspaceMat", IsMatrix ); +DeclareAttribute( "NullspaceMat", IsMatrixOrMatrixObj ); +DeclareAttribute( "TriangulizedNullspaceMat", IsMatrixOrMatrixObj ); ############################################################################# @@ -638,8 +638,8 @@ DeclareAttribute( "TriangulizedNullspaceMat", IsMatrix ); ## ## <#/GAPDoc> ## -DeclareOperation( "NullspaceMatDestructive", [ IsMatrix and IsMutable] ); -DeclareOperation( "TriangulizedNullspaceMatDestructive", [ IsMatrix and IsMutable] ); +DeclareOperation( "NullspaceMatDestructive", [ IsMatrixOrMatrixObj and IsMutable] ); +DeclareOperation( "TriangulizedNullspaceMatDestructive", [ IsMatrixOrMatrixObj and IsMutable] ); ############################################################################# @@ -711,7 +711,7 @@ DeclareOperation( "Eigenvalues", [ IsRing, IsMatrixOrMatrixObj ] ); ## ## <#/GAPDoc> ## -DeclareOperation( "Eigenspaces", [ IsRing, IsMatrix ] ); +DeclareOperation( "Eigenspaces", [ IsRing, IsMatrixOrMatrixObj ] ); ############################################################################# ## @@ -727,7 +727,7 @@ DeclareOperation( "Eigenspaces", [ IsRing, IsMatrix ] ); ## ## <#/GAPDoc> ## -DeclareOperation( "Eigenvectors", [ IsRing, IsMatrix ] ); +DeclareOperation( "Eigenvectors", [ IsRing, IsMatrixOrMatrixObj ] ); ############################################################################# @@ -858,7 +858,7 @@ DeclareSynonymAttr( "RankMatDestructive", RankMatrixDestructive ); ## ## <#/GAPDoc> ## -DeclareAttribute( "SemiEchelonMat", IsMatrix ); +DeclareAttribute( "SemiEchelonMat", IsMatrixOrMatrixObj ); ############################################################################# ## @@ -882,7 +882,7 @@ DeclareAttribute( "SemiEchelonMat", IsMatrix ); ## ## <#/GAPDoc> ## -DeclareOperation( "SemiEchelonMatDestructive", [ IsMatrix and IsMutable] ); +DeclareOperation( "SemiEchelonMatDestructive", [ IsMatrixOrMatrixObj and IsMutable] ); ############################################################################# @@ -919,7 +919,7 @@ DeclareOperation( "SemiEchelonMatDestructive", [ IsMatrix and IsMutable] ); ## ## <#/GAPDoc> ## -DeclareAttribute( "SemiEchelonMatTransformation", IsMatrix ); +DeclareAttribute( "SemiEchelonMatTransformation", IsMatrixOrMatrixObj ); ############################################################################# ## @@ -935,7 +935,7 @@ DeclareAttribute( "SemiEchelonMatTransformation", IsMatrix ); ## ## DeclareOperation( "SemiEchelonMatTransformationDestructive", [ - IsMatrix and IsMutable ] ); + IsMatrixOrMatrixObj and IsMutable ] ); ############################################################################# @@ -1067,7 +1067,7 @@ DeclareSynonym( "MutableTransposedMat", TransposedMatMutable ); # needed? ## ## ## -DeclareOperation( "MutableTransposedMatDestructive", [IsMatrix and IsMutable] ); +DeclareOperation( "MutableTransposedMatDestructive", [IsMatrixOrMatrixObj and IsMutable] ); ############################################################################# @@ -1095,7 +1095,7 @@ DeclareOperation( "MutableTransposedMatDestructive", [IsMatrix and IsMutable] ); ## ## <#/GAPDoc> ## -DeclareOperation( "TransposedMatDestructive", [ IsMatrix ] ); +DeclareOperation( "TransposedMatDestructive", [ IsMatrixOrMatrixObj ] ); @@ -1118,7 +1118,7 @@ DeclareOperation( "TransposedMatDestructive", [ IsMatrix ] ); ## ## <#/GAPDoc> ## -DeclareProperty( "IsMonomialMatrix", IsMatrix ); +DeclareProperty( "IsMonomialMatrix", IsMatrixOrMatrixObj ); ############################################################################# @@ -1143,7 +1143,7 @@ DeclareProperty( "IsMonomialMatrix", IsMatrix ); ## ## <#/GAPDoc> ## -DeclareOperation( "InverseMatMod", [ IsMatrix, IsObject ] ); +DeclareOperation( "InverseMatMod", [ IsMatrixOrMatrixObj, IsObject ] ); ############################################################################# @@ -1178,11 +1178,11 @@ DeclareOperation( "KroneckerProduct", [ IsMatrixOrMatrixObj, IsMatrixOrMatrixObj ## ## ## -## Does thework for SolutionMat and SolutionMatDestructive. +## Does the work for SolutionMat and SolutionMatDestructive. ## ## ## -DeclareOperation( "SolutionMatNoCo", [ IsMatrix, IsRowVector ] ); +DeclareOperation( "SolutionMatNoCo", [ IsMatrixOrMatrixObj, IsRowVector ] ); ############################################################################# @@ -1200,7 +1200,7 @@ DeclareOperation( "SolutionMatNoCo", [ IsMatrix, IsRowVector ] ); ## ## <#/GAPDoc> ## -DeclareOperation( "SolutionMat", [ IsMatrix, IsRowVector ] ); +DeclareOperation( "SolutionMat", [ IsMatrixOrMatrixObj, IsRowVector ] ); ############################################################################# ## @@ -1232,7 +1232,7 @@ DeclareOperation( "SolutionMat", [ IsMatrix, IsRowVector ] ); ## <#/GAPDoc> ## DeclareOperation( "SolutionMatDestructive", - [ IsMatrix and IsMutable, IsRowVector ] ); + [ IsMatrixOrMatrixObj and IsMutable, IsRowVector ] ); ############################################################################ @@ -1258,7 +1258,7 @@ DeclareOperation( "SolutionMatDestructive", ## ## <#/GAPDoc> ## -DeclareOperation( "SumIntersectionMat", [ IsMatrix, IsMatrix ] ); +DeclareOperation( "SumIntersectionMat", [ IsMatrixOrMatrixObj, IsMatrixOrMatrixObj ] ); @@ -1281,7 +1281,7 @@ DeclareOperation( "SumIntersectionMat", [ IsMatrix, IsMatrix ] ); ## ## <#/GAPDoc> ## -DeclareOperation( "TriangulizedMat", [ IsMatrix ] ); +DeclareOperation( "TriangulizedMat", [ IsMatrixOrMatrixObj ] ); DeclareSynonym( "RREF", TriangulizedMat); ############################################################################# @@ -1312,7 +1312,7 @@ DeclareSynonym( "RREF", TriangulizedMat); ## ## <#/GAPDoc> ## -DeclareOperation( "TriangulizeMat", [ IsMatrix and IsMutable ] ); +DeclareOperation( "TriangulizeMat", [ IsMatrixOrMatrixObj and IsMutable ] ); ############################################################################# @@ -1506,7 +1506,7 @@ DeclareGlobalFunction( "BlownUpVector" ); ## ## <#/GAPDoc> ## -DeclareOperation( "DiagonalizeMat", [IsRing,IsMatrix and IsMutable] ); +DeclareOperation( "DiagonalizeMat", [IsRing, IsMatrixOrMatrixObj and IsMutable] ); ############################################################################# @@ -1960,7 +1960,7 @@ DeclareSynonymAttr( "TraceMat", TraceMatrix ); ## ## <#/GAPDoc> ## -DeclareAttribute( "JordanDecomposition", IsMatrix ); +DeclareAttribute( "JordanDecomposition", IsMatrixOrMatrixObj ); ############################################################################# @@ -2143,7 +2143,7 @@ DeclareOperation( "CharacteristicPolynomial", ## DeclareOperation("CharacteristicPolynomialMatrixNC", #IsField is not yet known - [IsRing,IsOrdinaryMatrix,IsPosInt]); + [IsRing,IsMatrixOrMatrixObj,IsPosInt]); ############################################################################# @@ -2161,7 +2161,7 @@ DeclareOperation("CharacteristicPolynomialMatrixNC", ## DeclareOperation("MinimalPolynomialMatrixNC", #IsField is not yet known - [IsRing,IsOrdinaryMatrix,IsPosInt]); + [IsRing,IsMatrixOrMatrixObj,IsPosInt]); ############################################################################# ## From 98c438c4bc8a60e7a6753c1e1d39aec61a552338 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 4 Sep 2025 14:15:33 +0200 Subject: [PATCH 4/5] Generalize a bunch of matrix operations to MatrixObj --- lib/matobj1.gd | 10 ++++++++-- lib/matrix.gi | 26 +++++++++++++------------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/lib/matobj1.gd b/lib/matobj1.gd index 0532865648..4c207bd06f 100644 --- a/lib/matobj1.gd +++ b/lib/matobj1.gd @@ -275,14 +275,14 @@ DeclareCategory( "IsCyclotomicVectorObj", IsVectorObj ); DeclareCategory( "IsFFEMatrixOrMatrixObj", IsMatrixOrMatrixObj ); # DeclareSynonym( "IsFFEMatrix", IsFFEMatrixOrMatrixObj and IsMatrix ); -# DeclareSynonym( "IsFFEMatrixObj", IsFFEMatrixOrMatrixObj and IsMatrixObj ); +DeclareSynonym( "IsFFEMatrixObj", IsFFEMatrixOrMatrixObj and IsMatrixObj ); # or maybe # DeclareProperty( "IsFFEMatrix", IsMatrix ); # DeclareProperty( "IsFFEMatrixObj", IsMatrixObj ); DeclareCategory( "IsCyclotomicMatrixOrMatrixObj", IsMatrixOrMatrixObj ); # DeclareSynonym( "IsCyclotomicMatrix", IsCyclotomicMatrixOrMatrixObj and IsMatrix ); -# DeclareSynonym( "IsCyclotomicMatrixObj", IsCyclotomicMatrixOrMatrixObj and IsMatrixObj ); +DeclareSynonym( "IsCyclotomicMatrixObj", IsCyclotomicMatrixOrMatrixObj and IsMatrixObj ); # or maybe have them be properties with methods so users are not confused ?!? # DeclareProperty( "IsCyclotomicMatrix", IsMatrix ); # DeclareProperty( "IsCyclotomicMatrixObj", IsMatrixObj ); @@ -292,6 +292,12 @@ InstallTrueMethod( IsFFEMatrixOrMatrixObj, IsFFECollColl and IsMatrix ); InstallTrueMethod( IsCyclotomicMatrixOrMatrixObj, IsCyclotomicCollColl and IsMatrix ); +DeclareCategoryCollections( "IsFFEMatrixObj" ); +DeclareCategoryCollections( "IsCyclotomicMatrixObj" ); + +#DeclareCategoryCollections( "IsFFE" ); +#DeclareCategoryCollections( "IsFFECollection" ); + ############################################################################# ## diff --git a/lib/matrix.gi b/lib/matrix.gi index 9134c1840d..3d74e3bfa2 100644 --- a/lib/matrix.gi +++ b/lib/matrix.gi @@ -772,7 +772,7 @@ InstallMethod( CharacteristicPolynomial, "spinning over field", fi; return false; end, - [ IsField, IsField, IsOrdinaryMatrix, IsPosInt ], + [ IsField, IsField, IsMatrixOrMatrixObj, IsPosInt ], function( F, E, mat, inum ) local B; @@ -791,7 +791,7 @@ InstallMethod( CharacteristicPolynomial, "spinning over field", InstallMethod( CharacteristicPolynomialMatrixNC, "spinning over field", IsElmsCollsX, - [ IsField, IsOrdinaryMatrix, IsPosInt ], + [ IsField, IsMatrixOrMatrixObj, IsPosInt ], Matrix_CharacteristicPolynomialSameField); InstallOtherMethod( CharacteristicPolynomial, @@ -835,7 +835,7 @@ InstallOtherMethod( CharacteristicPolynomialMatrixNC, InstallMethod( MinimalPolynomial, "spinning over field", IsElmsCollsX, - [ IsField, IsOrdinaryMatrix, IsPosInt ], + [ IsField, IsMatrixOrMatrixObj, IsPosInt ], function( F, mat,inum ) local fld, B; @@ -872,7 +872,7 @@ end); InstallMethod( MinimalPolynomialMatrixNC, "spinning over field", IsElmsCollsX, - [ IsField, IsOrdinaryMatrix, IsPosInt ], + [ IsField, IsMatrixOrMatrixObj, IsPosInt ], Matrix_MinimalPolynomialSameField); InstallOtherMethod( MinimalPolynomial, @@ -1555,7 +1555,7 @@ end); ## InstallMethod( DeterminantMatDestructive, "fraction-free method", - [ IsOrdinaryMatrix and IsMutable], + [ IsMatrixOrMatrixObj and IsMutable], function ( mat ) local det, sgn, row, zero, m, i, j, k, mult, row2, piv; @@ -1626,7 +1626,7 @@ end); ## through here also. ## InstallMethod( DeterminantMatDestructive,"non fraction free", - [ IsOrdinaryMatrix and IsFFECollColl and IsMutable], + [ IsMatrixOrMatrixObj and IsFFECollColl and IsMutable], function( mat ) local m, zero, det, sgn, k, j, row, l, row2, x; @@ -1701,7 +1701,7 @@ InstallMethod( DeterminantMat, end ); InstallMethod( DeterminantMatDestructive,"nonprime residue rings", - [ IsOrdinaryMatrix and + [ IsMatrixOrMatrixObj and CategoryCollections(CategoryCollections(IsZmodnZObjNonprime)) and IsMutable], DeterminantMatDivFree); @@ -1737,7 +1737,7 @@ InstallMethod( DeterminantMatDestructive,"nonprime residue rings", ## InstallMethod( DeterminantMatDivFree, "Division-free method", - [ IsMatrix ], + [ IsMatrixOrMatrixObj ], function ( M ) local u,v,w,i, ## indices a,b,c,x,y, ## temp indices @@ -2293,7 +2293,7 @@ end ); ## InstallMethod( NullspaceMat, "generic method for ordinary matrices", - [ IsOrdinaryMatrix ], + [ IsMatrixOrMatrixObj ], mat -> SemiEchelonMatTransformation(mat).relations ); InstallOtherMethod(NullspaceMat,"matrix objects",[IsMatrixObj], @@ -2314,7 +2314,7 @@ end); InstallMethod( NullspaceMatDestructive, "generic method for ordinary matrices", - [ IsOrdinaryMatrix and IsMutable], + [ IsMatrixOrMatrixObj and IsMutable], mat -> SemiEchelonMatTransformationDestructive(mat).relations ); InstallOtherMethod( TriangulizedNullspaceMat, @@ -2339,7 +2339,7 @@ end ); InstallMethod( TriangulizedNullspaceMatNT, "generic method", - [ IsOrdinaryMatrix ], + [ IsMatrixOrMatrixObj ], function( mat ) local nullspace, n, empty, i, k, row, zero, one;# @@ -2383,7 +2383,7 @@ InstallMethod( TriangulizedNullspaceMatNT, end ); #InstallMethod(TriangulizedNullspaceMat,"generic method", -# [IsOrdinaryMatrix], +# [IsMatrixOrMatrixObj], # function ( mat ) # # triangulize the transposed of the matrix # return TriangulizedNullspaceMatNT( @@ -2391,7 +2391,7 @@ end ); #end ); #InstallMethod(TriangulizedNullspaceMatDestructive,"generic method", -# [IsOrdinaryMatrix], +# [IsMatrixOrMatrixObj], # function ( mat ) # # triangulize the transposed of the matrix # return TriangulizedNullspaceMatNT( From a845556f42eed5ffbc0b257ddb3e772801b59f03 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 24 Mar 2026 22:38:03 +0100 Subject: [PATCH 5/5] Some experiments --- lib/grpmat.gd | 2 +- lib/matobj1.gd | 4 ++-- lib/vecmat.gi | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/grpmat.gd b/lib/grpmat.gd index 6c1a384ab1..1422e18a5e 100644 --- a/lib/grpmat.gd +++ b/lib/grpmat.gd @@ -27,7 +27,7 @@ ## <#/GAPDoc> ## DeclareCategory( "IsMatrixGroup", IsGroup ); -InstallTrueMethod( IsMatrixGroup, IsRingElementCollCollColl and IsGroup ); +InstallTrueMethod( IsMatrixGroup, IsRingElementCollCollColl and IsGroup ); # TODO ############################################################################# ## diff --git a/lib/matobj1.gd b/lib/matobj1.gd index 4c207bd06f..6421d5db26 100644 --- a/lib/matobj1.gd +++ b/lib/matobj1.gd @@ -274,14 +274,14 @@ DeclareCategory( "IsFFEVectorObj", IsVectorObj ); DeclareCategory( "IsCyclotomicVectorObj", IsVectorObj ); DeclareCategory( "IsFFEMatrixOrMatrixObj", IsMatrixOrMatrixObj ); -# DeclareSynonym( "IsFFEMatrix", IsFFEMatrixOrMatrixObj and IsMatrix ); +DeclareSynonym( "IsFFEMatrix", IsFFEMatrixOrMatrixObj and IsMatrix ); DeclareSynonym( "IsFFEMatrixObj", IsFFEMatrixOrMatrixObj and IsMatrixObj ); # or maybe # DeclareProperty( "IsFFEMatrix", IsMatrix ); # DeclareProperty( "IsFFEMatrixObj", IsMatrixObj ); DeclareCategory( "IsCyclotomicMatrixOrMatrixObj", IsMatrixOrMatrixObj ); -# DeclareSynonym( "IsCyclotomicMatrix", IsCyclotomicMatrixOrMatrixObj and IsMatrix ); +DeclareSynonym( "IsCyclotomicMatrix", IsCyclotomicMatrixOrMatrixObj and IsMatrix ); DeclareSynonym( "IsCyclotomicMatrixObj", IsCyclotomicMatrixOrMatrixObj and IsMatrixObj ); # or maybe have them be properties with methods so users are not confused ?!? # DeclareProperty( "IsCyclotomicMatrix", IsMatrix ); diff --git a/lib/vecmat.gi b/lib/vecmat.gi index 6d8addd44d..241af74205 100644 --- a/lib/vecmat.gi +++ b/lib/vecmat.gi @@ -863,8 +863,9 @@ InstallMethod( InverseOp, InstallMethod( InverseSameMutability, "for plain list of GF2 vectors", true, - [ IsPlistRep and IsFFECollColl and IsMatrix], - 0, + [ IsPlistRep and IsFFEMatrixOrMatrixObj], + {} -> RankFilter(IsPlistRep and IsFFECollColl and IsMatrix) + - RankFilter(IsPlistRep and IsFFEMatrixOrMatrixObj), function(m) local inv,i; inv := INV_PLIST_GF2VECS_DESTRUCTIVE(List(m, ShallowCopy));