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
31 changes: 20 additions & 11 deletions gap/basic/pcppara.gi
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ end );
##
InstallGlobalFunction( AddToIgsParallel,
function( pcs, gens, ppcs, pgens )
local coll, rels, n, inf, todo, tododo, ind, indd, g, gg, d, h, hh, k,
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;

if Length( gens ) = 0 then return [pcs, ppcs]; fi;
Expand Down Expand Up @@ -172,16 +172,25 @@ function( pcs, gens, ppcs, pgens )
g := g^0;
gg := gg^0;
else
pairs := GcdPcpPara(g, h, gg, hh);
h := pairs[1];
g := pairs[2];
hh := pairs[3];
gg := pairs[4];
if h <> ind[d] then
nrmd := NormedPcpElementPara( h, hh );
ind[d] := nrmd[1];
indd[d] := nrmd[2];
AddSet(f, d);
a := LeadingExponent(g);
b := LeadingExponent(h);
if a > 0 and b > 0 and a mod b = 0 then
# GcdPcpPara would leave h and hh unchanged.
q := a/b;
g := g * h^-q;
gg := gg * hh^-q;
else
pairs := GcdPcpPara(g, h, gg, hh);
h := pairs[1];
g := pairs[2];
hh := pairs[3];
gg := pairs[4];
if h <> ind[d] then
nrmd := NormedPcpElementPara( h, hh );
ind[d] := nrmd[1];
indd[d] := nrmd[2];
AddSet(f, d);
fi;
fi;
fi;
d := Depth(g);
Expand Down
21 changes: 14 additions & 7 deletions gap/basic/pcppcps.gi
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ end );
#F AddToIgs( <igs>, <gens> )
##
InstallGlobalFunction(AddToIgs, function(igs, gens)
local coll, rels, n, inf, c, ind, g, d, todo, val, j, f, h, k, pair, t;
local coll, rels, n, inf, c, ind, g, d, todo, val, j, f, h, a, b, k, pair, t;

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

Expand Down Expand Up @@ -176,12 +176,19 @@ InstallGlobalFunction(AddToIgs, function(igs, gens)
if g = h then
g := g^0;
else
pair := GcdPcp(g, h);
h := pair[1];
g := pair[2];
if h <> ind[d] then
ind[d] := NormedPcpElement( h );
AddSet(f, d);
a := LeadingExponent(g);
b := LeadingExponent(h);
if a > 0 and b > 0 and a mod b = 0 then
# GcdPcp would leave h unchanged.
g := g * h^(-a/b);
else
pair := GcdPcp(g, h);
h := pair[1];
g := pair[2];
if h <> ind[d] then
ind[d] := NormedPcpElement( h );
AddSet(f, d);
fi;
fi;
fi;
d := Depth(g);
Expand Down
Loading