Skip to content

Commit

Permalink
WIP pquot: always keep SCP_WEIGHTS immutable
Browse files Browse the repository at this point in the history
This matters for HPC-GAP, where the collector is made read-only
once it is used in a
  • Loading branch information
fingolfin committed Oct 25, 2019
1 parent fb89263 commit 9db1e68
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions lib/pquot.gi
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ end );
##
UpdateWeightInfo := function( qs )
local n, nhwg, ranks, class, last_in_cl, avector, cl, wt,
avc2, g, h;
avc2, g, h, i;

n := GeneratorNumberOfQuotient(qs);
nhwg := qs!.numberOfHighestWeightGenerators;
Expand All @@ -502,8 +502,11 @@ UpdateWeightInfo := function( qs )
class := class + 1;
qs!.collector![SCP_CLASS] := class;

wt := qs!.collector![SCP_WEIGHTS];
wt{n+[1..nhwg]} := [1..nhwg] * 0 + class;
wt := ShallowCopy(qs!.collector![SCP_WEIGHTS]);
for i in [1..nhwg] do
wt[n+i] := class;
od;
qs!.collector![SCP_WEIGHTS] := MakeImmutable(wt);

avc2 := [1..n]+0;
for g in [1..n] do
Expand Down Expand Up @@ -1321,7 +1324,7 @@ end );
InstallGlobalFunction( AbelianPQuotient,
function( qs )
local G, one, n, gens, LTM, trailers, d,
generators, i, r, l;
generators, i, r, l, wt;

# Setup some variables.
G := qs!.preimage;
Expand Down Expand Up @@ -1371,8 +1374,12 @@ function( qs )

## Update the weight information
qs!.collector![SCP_CLASS] := 1;
qs!.collector![SCP_WEIGHTS]{[1..qs!.numberOfGenerators]} :=
[1..qs!.numberOfGenerators] * 0 + 1;
wt := ShallowCopy(qs!.collector![SCP_WEIGHTS]);
for i in [1..qs!.numberOfGenerators] do
wt[i] := 1;
od;
qs!.collector![SCP_WEIGHTS] := MakeImmutable(wt);


end );

Expand Down

0 comments on commit 9db1e68

Please sign in to comment.