From 106f7f08a88daf0e637d166cca4d9a951c88b3ab Mon Sep 17 00:00:00 2001 From: Alexander Hulpke Date: Tue, 12 Feb 2019 15:59:46 +1100 Subject: [PATCH 1/3] FIX: Sparse Action homomorphisms cannot use `OrbitishFO` but need to use their own creator function (as point seed is list of points and thus need to apply `TestIdentityAction` differently.) This fixes #3279 --- lib/oprt.gd | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 79 insertions(+), 4 deletions(-) diff --git a/lib/oprt.gd b/lib/oprt.gd index 82b762daf7..64480e38c8 100644 --- a/lib/oprt.gd +++ b/lib/oprt.gd @@ -1075,10 +1075,85 @@ DeclareGlobalFunction("MultiActionsHomomorphism"); ## ## <#/GAPDoc> ## -OrbitishFO( "SparseActionHomomorphism", OrbitishReq, - IsIdenticalObj, false,false ); -OrbitishFO( "SortedSparseActionHomomorphism", OrbitishReq, - IsIdenticalObj, false,false ); + +BindGlobal( "SparseActHomFO", function( name, reqs, famrel ) +local str, orbish, func; + + # Create the operation. + str:= SHALLOW_COPY_OBJ( name ); + + APPEND_LIST_INTR( str, "Op" ); + orbish := NewOperation( str, reqs ); + BIND_GLOBAL( str, orbish ); + + # Create the wrapper function. + func := function( arg ) + local G, D, pnt, gens, acts, act, xset, p, attrG, result,le; + + # Get the arguments. + if 2 <= Length( arg ) then + le:=Length(arg); + G := arg[ 1 ]; + if IsFunction( arg[ le ] ) then + act := arg[ le ]; + le:=le-1; + else + act := OnPoints; + fi; + if Length( arg ) > 2 + and famrel( FamilyObj( arg[ 2 ] ), FamilyObj( arg[ 3 ] ) ) + then + D := arg[ 2 ]; + if IsDomain( D ) then + if IsFinite( D ) then D:= AsSSortedList( D ); else D:= Enumerator( D ); fi; + fi; + p := 3; + else + p := 2; + fi; + pnt := Immutable(arg[ p ]); + if Length( arg ) > p + 1 then + gens := arg[ p + 1 ]; + acts := arg[ p + 2 ]; + fi; + else + Error( "usage: ", name, "(,)\n", + "or ", name, "([,],[,,][,])" ); + fi; + + G := PreOrbishProcessing(G); + + if not IsBound( gens ) then + if (not IsPermGroup(G)) and CanEasilyComputePcgs( G ) then + gens := Pcgs( G ); + else + gens := GeneratorsOfGroup( G ); + fi; + acts := gens; + fi; + + for p in pnt do + TestIdentityAction(acts,p,act); + od; + + if IsBound( D ) then + result := orbish( G, D, pnt, gens, acts, act ); + else + + # The following line is also executed when `Blocks(, , )' + # is called to compute blocks with no seed, but then is really + # , i.e., the operation domain! + result := orbish( G, pnt, gens, acts, act ); + + fi; + + return result; + end; + BIND_GLOBAL( name, func ); +end ); + +SparseActHomFO( "SparseActionHomomorphism", OrbitishReq, IsIdenticalObj ); +SparseActHomFO( "SortedSparseActionHomomorphism", OrbitishReq, IsIdenticalObj ); ############################################################################# ## From e18d38bec820c50f95e5b535ede1f5ade7c7dd58 Mon Sep 17 00:00:00 2001 From: Alexander Hulpke Date: Thu, 14 Feb 2019 11:37:06 +1100 Subject: [PATCH 2/3] CLEANUP: Remove `PreOrbishProcessing` that does nothing. --- lib/oprt.gd | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/oprt.gd b/lib/oprt.gd index 64480e38c8..3f4810a680 100644 --- a/lib/oprt.gd +++ b/lib/oprt.gd @@ -747,10 +747,6 @@ end ); ## ## <#/GAPDoc> ## -DeclareOperation( "PreOrbishProcessing", [IsGroup]); - -InstallMethod( PreOrbishProcessing, [IsGroup], x->x ); - BindGlobal( "OrbitishFO", function( name, reqs, famrel, usetype,realenum ) local str, orbish, func,isnotest; @@ -824,8 +820,6 @@ local str, orbish, func,isnotest; "or ", name, "([,],[,,][,])" ); fi; - G := PreOrbishProcessing(G); - if not IsBound( gens ) then if (not IsPermGroup(G)) and CanEasilyComputePcgs( G ) then gens := Pcgs( G ); @@ -1121,8 +1115,6 @@ local str, orbish, func; "or ", name, "([,],[,,][,])" ); fi; - G := PreOrbishProcessing(G); - if not IsBound( gens ) then if (not IsPermGroup(G)) and CanEasilyComputePcgs( G ) then gens := Pcgs( G ); From da453d98448788c44471cd495d89789fdfeae60d Mon Sep 17 00:00:00 2001 From: Alexander Hulpke Date: Thu, 14 Feb 2019 11:41:54 +1100 Subject: [PATCH 3/3] CLEANUP: Comments, unnecessary commands and error messages. --- lib/oprt.gd | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/oprt.gd b/lib/oprt.gd index 3f4810a680..7d3be142a1 100644 --- a/lib/oprt.gd +++ b/lib/oprt.gd @@ -1082,7 +1082,7 @@ local str, orbish, func; # Create the wrapper function. func := function( arg ) - local G, D, pnt, gens, acts, act, xset, p, attrG, result,le; + local G, D, pnt, gens, acts, act, p, attrG, result,le; # Get the arguments. if 2 <= Length( arg ) then @@ -1090,7 +1090,6 @@ local str, orbish, func; G := arg[ 1 ]; if IsFunction( arg[ le ] ) then act := arg[ le ]; - le:=le-1; else act := OnPoints; fi; @@ -1111,8 +1110,7 @@ local str, orbish, func; acts := arg[ p + 2 ]; fi; else - Error( "usage: ", name, "(,)\n", - "or ", name, "([,],[,,][,])" ); + Error( "usage: ", name, "([,],[,,][,])" ); fi; if not IsBound( gens ) then @@ -1131,12 +1129,7 @@ local str, orbish, func; if IsBound( D ) then result := orbish( G, D, pnt, gens, acts, act ); else - - # The following line is also executed when `Blocks(, , )' - # is called to compute blocks with no seed, but then is really - # , i.e., the operation domain! result := orbish( G, pnt, gens, acts, act ); - fi; return result;