Skip to content
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
16 changes: 14 additions & 2 deletions gap/basic/pcppara.gi
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ end );
##
InstallGlobalFunction( AddToIgsParallel,
function( pcs, gens, ppcs, pgens )
local coll, rels, n, inf, todo, tododo, ind, indd, g, gg, d, h, hh, a, b, q, k,
c, i, r, sub, keep, val, j, f, nrmd, pairs;
local coll, rels, n, inf, todo, tododo, ind, indd, g, gg, d, h, hh, a, b,
q, k, c, i, r, sub, keep, val, j, f, nrmd, pairs, added;

if Length( gens ) = 0 then return [pcs, ppcs]; fi;

Expand All @@ -133,6 +133,9 @@ function( pcs, gens, ppcs, pgens )
indd[d] := ppcs[i];
od;

# initial gens still need to be reduced
added := true;

# do a reduction step
c := TailLimit(ind, c);
sub := Filtered([1..Length(gens)], i -> Depth(gens[i]) < c);
Expand All @@ -150,6 +153,7 @@ function( pcs, gens, ppcs, pgens )
j := PositionMinimum(val);
g := Remove(todo, j);
gg := Remove(tododo, j);
Remove(val, j);
d := Depth( g );
f := [];

Expand Down Expand Up @@ -196,11 +200,16 @@ function( pcs, gens, ppcs, pgens )
d := Depth(g);
od;

# ind unchanged and every todo entry already reduced, so ReduceExpo,
# TailLimit and the filter would be no-ops
if Length(f) = 0 and not added then continue; fi;

# adjust
c := TailLimit(ind, c);
if inf then ReduceExpoPara(ind, todo, indd, tododo, rels); fi;

# add powers and commutators
added := false;
for d in f do
g := ind[d];
gg := indd[d];
Expand All @@ -210,6 +219,7 @@ function( pcs, gens, ppcs, pgens )
if Depth(k) < c then
Add(todo, k);
Add(tododo, gg^r);
added := true;
fi;
fi;
for j in [1..n] do
Expand All @@ -221,12 +231,14 @@ function( pcs, gens, ppcs, pgens )
if Depth(k) < c then
Add(todo, k);
Add(tododo, Comm(gg, indd[j]));
added := true;
fi;
if rels[j] = 0 then
k := Comm(g, ind[j]^-1);
if Depth(k) < c then
Add(todo, k);
Add(tododo, Comm(gg, indd[j]^-1));
added := true;
fi;
fi;
fi;
Expand Down
27 changes: 23 additions & 4 deletions gap/basic/pcppcps.gi
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ end );
#F AddToIgs( <igs>, <gens> )
##
InstallGlobalFunction(AddToIgs, function(igs, gens)
local coll, rels, n, inf, c, ind, g, d, todo, val, j, f, h, a, b, k, pair, t;
local coll, rels, n, inf, c, ind, g, d, todo, val, j, f, h, a, b, k,
pair, t, added;

if Length(gens) = 0 then return igs; fi;

Expand All @@ -151,6 +152,9 @@ InstallGlobalFunction(AddToIgs, function(igs, gens)
ind := ListWithIdenticalEntries(n, false);
for g in igs do ind[Depth(g)] := g; od;

# initial gens still need to be reduced
added := true;

# do a reduction step
c := TailLimit(ind, c);
todo := Set(Filtered(gens, x -> Depth(x) < c));
Expand All @@ -160,6 +164,7 @@ InstallGlobalFunction(AddToIgs, function(igs, gens)
while Length(todo) > 0 and c > 1 do
j := PositionMinimum(val);
g := Remove(todo, j);
Remove(val, j);
d := Depth(g);
f := [];

Expand Down Expand Up @@ -194,17 +199,25 @@ InstallGlobalFunction(AddToIgs, function(igs, gens)
d := Depth(g);
od;

# ind unchanged and every todo entry already reduced, so ReduceExpo,
# TailLimit and the filter would be no-ops
if Length(f) = 0 and not added then continue; fi;

# adjust
c := TailLimit(ind, c);
if inf then ReduceExpo(ind, todo, rels); fi;

# add powers and commutators
added := false;
for d in f do
g := ind[d];
# skip infinite factors and powers in the tail
if d < c-1 and rels[d] > 0 then
k := g ^ RelativeOrderPcp(g);
if Depth(k) < c then Add(todo, k); fi;
if Depth(k) < c then
Add(todo, k);
added := true;
fi;
fi;
for j in [1..n] do
# skip trivial commutators and those in the tail
Expand All @@ -213,10 +226,16 @@ InstallGlobalFunction(AddToIgs, function(igs, gens)
fi;
if not IsBool(ind[j]) then
k := Comm(g, ind[j]);
if Depth(k) < c then Add(todo, k); fi;
if Depth(k) < c then
Add(todo, k);
added := true;
fi;
if rels[j] = 0 then
k := Comm(g, ind[j]^-1);
if Depth(k) < c then Add(todo, k); fi;
if Depth(k) < c then
Add(todo, k);
added := true;
fi;
fi;
fi;
od;
Expand Down
Loading