Skip to content

Commit

Permalink
Speed up StabChainBaseStrongGenerators
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisJefferson authored and fingolfin committed Mar 25, 2021
1 parent 0644440 commit adf8fb2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
18 changes: 12 additions & 6 deletions lib/stbc.gi
Original file line number Diff line number Diff line change
Expand Up @@ -396,23 +396,29 @@ end);
#F StabChainBaseStrongGenerators( <base>, <sgs>[, <one>] )
##
InstallGlobalFunction(StabChainBaseStrongGenerators,function(arg)
local base,sgs,one,S, T, pnt;
local base,sgs,one,S, T, pnt, genlabels;

base:=arg[1];
sgs:=arg[2];
base:=PlainListCopy(arg[1]);
sgs:=PlainListCopy(arg[2]);
if Length(arg)=3 then
one:=arg[3];
else
one:= One(arg[2][1]);
fi;
S := EmptyStabChain( [ ], one );
S := EmptyStabChain( sgs, one );
# Skip the identity in genlabels
Assert(2, S.labels[1] = ());
genlabels := PlainListCopy([2..Length(S.labels)]);
T := S;
for pnt in base do
InsertTrivialStabilizer( T, pnt );
AddGeneratorsExtendSchreierTree( T, sgs );
sgs := Filtered( sgs, g -> pnt ^ g = pnt );
T.genlabels := genlabels;
T.generators := T.labels{T.genlabels};
AGEST(T.orbit, T.genlabels, T.labels, T.translabels, T.transversal, T.genlabels);
genlabels := Filtered(genlabels, x -> pnt^sgs[x] = pnt);
T := T.stabilizer;
od;

return S;
end);

Expand Down
11 changes: 10 additions & 1 deletion tst/testinstall/stabchain.tst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#@local TestGens,m
gap> START_TEST("stabchain.tst");
gap> TestGens := function(g)
> local m;
> local m, sc;
> m := SortedList(List(g));
> if Size(m) <> Size(g) or Size(Set(m)) <> Size(m) or
> Group(m) <> g then Print("0"); fi;
Expand All @@ -14,10 +14,19 @@ gap> TestGens := function(g)
> ChangeStabChain(StabChainMutable(g), [1,10,11,12,13,14,15,2,3,4,5,6,7,8], false);
> if m <> SortedList(List(g)) then Print("5"); fi;
> if m <> SortedList(List(g, x -> x)) then Print("4"); fi;
> sc := StabChainBaseStrongGenerators([1,10,11,12,13,14,15,2,3,4,5,6,7,8],
> StrongGeneratorsStabChain(StabChainMutable(g)), ());
> g := Group(GeneratorsOfGroup(g), ());
> SetStabChainMutable(g, sc);
> if m <> SortedList(List(g)) then Print(g,"6"); fi;
> if m <> SortedList(List(g, x -> x)) then Print(g,"7"); fi;
> return true;
> end;;
gap> TestGens(Group(()));;
gap> List([2..7],
> x -> List([1..NrTransitiveGroups(x)],
> y -> TestGens(TransitiveGroup(x,y))));;
gap> TestGens(Group((1,2,3),(4,5,6)));;
gap> TestGens(Group((1,2,3)(4,5,6)));;
gap> TestGens(Group((2,4,6),(1,3,5),(1,3)));;
gap> STOP_TEST("stabchain.tst", 1);

0 comments on commit adf8fb2

Please sign in to comment.