Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

performance enhancements in subgroup lattice #3384

Merged
merged 2 commits into from
Mar 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions lib/grppclat.gi
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ end);
##
InstallGlobalFunction(ActionSubspacesElementaryAbelianGroup,function(arg)
local P,g,op,act,a,pcgs,ma,mat,d,f,i,j,new,newmat,id,p,dodim,compldim,compl,
dims,Pgens,Pcgens,Pu,Pc,perms,one,par,ker,kersz;
dims,Pgens,Pcgens,Pu,Pc,perms,one,par,ker,kersz,pcelm,pccache,asz;

P:=arg[1];
if IsModuloPcgs(arg[2]) then
Expand Down Expand Up @@ -432,15 +432,32 @@ local P,g,op,act,a,pcgs,ma,mat,d,f,i,j,new,newmat,id,p,dodim,compldim,compl,
ma:=new;

# convert to grps
pccache:=[]; # avoid recerating different copies of same element
pcelm:=function(vec)
local e,p;
e:=Immutable([vec]);
p:=PositionSorted(pccache,e);
if IsBound(pccache[p]) and pccache[p][1]=vec then
return pccache[p][2];
else
e:=Immutable([vec,PcElementByExponentsNC(pcgs,vec)]);
AddSet(pccache,e);
return e[2];
fi;
end;

new:=[];
for i in ma do
#a:=SubgroupNC(Parent(g),List(i,j->Product([1..d],k->pcgs[k]^j[k])));
asz:=kersz*p^Length(i);
if kersz=1 then
a:=SubgroupNC(par,List(i,j->PcElementByExponentsNC(pcgs,j)));
a:=SubgroupNC(par,List(i,j->pcelm(j)));
else
a:=ClosureGroup(ker,List(i,j->PcElementByExponentsNC(pcgs,j)));
#a:=ClosureGroup(ker,List(i,j->pcelm(j)):knownClosureSize:=asz);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you replace the ClosureGroup with the SubgroupNC? Is it faster? And given the replacement, why have you kept the ClosureGroup line as a comment?

a:=SubgroupNC(par,Concatenation(GeneratorsOfGroup(ker),
List(i,j->pcelm(j))));
fi;
SetSize(a,kersz*p^Length(i));
SetSize(a,asz);
Add(new,a);
od;

Expand Down
2 changes: 2 additions & 0 deletions lib/grpperm.gi
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,8 @@ BindGlobal("DoClosurePrmGp",function( G, gens, options )
fi;
od;
else
o:=ValueOption("knownClosureSize");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you intend for the knownClosureSize value option: if you're not using it in the code in the rest of the PR, and it's not documented, is there any point in it being there?

if IsInt(o) then options.limit:=o;fi;
chain := ClosureRandomPermGroup( chain, gens, options );
fi;

Expand Down