Skip to content

Commit 3c6c843

Browse files
authored
Merge pull request #23 from gap-packages/mh/PositionNonZero
Use GAP library function PositionNonZero
2 parents 93cf324 + 1c18311 commit 3c6c843

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

gap/grpalg/collect.gi

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@
55
##
66
## functions to work with tables (in the sense of ModIsom) which correspond to quotients of the augmentation ideal I of a group algebra of a finite p-group over a field of characteristic p modulo a power of I. In particular, to generate the table for this quotient
77

8-
# Input: A list
9-
# Output: The nonzero positions of the list
10-
BindGlobal("PosNonzero", function(list)
11-
return PositionsProperty(list, x -> not IsZero(x));
12-
end);
13-
14-
158
# Input: Linear combination of words. A word is a list of pairs of natural numbers. We think e.g. g1^2*g3 = [[1,2],[3,1]]
169
# Output: Same linear combination (in the math sense) where each word
1710
# appears at most once
@@ -198,7 +191,7 @@ local w, sw, pos, p;
198191

199192
sw := 0;
200193
w := [ ];
201-
pos := PosNonzero(exp);
194+
pos := PositionNonZero(exp);
202195

203196
for p in pos do
204197
sw := sw + 1;
@@ -443,7 +436,7 @@ local F, p, exp, pos1, i, j, pows, pos, combs, v, c, w, s, m, tup, coefprod, exp
443436
# Check if weight of p-th power exceeds level
444437
if p*T.pre.weights[i] <= lvl then
445438
pows := StructuralCopy(T.pre.jen.pows[pos1]);
446-
pos := PosNonzero(pows);
439+
pos := PositionNonZero(pows);
447440
pows := pows{pos};
448441
combs := Combinations([1..Length(pos)]);
449442
Remove(combs, 1);
@@ -523,7 +516,7 @@ local F, p, exp, pos1, i, j, pows, pos, combs, v, c, w, s, m, tup, coefprod, exp
523516
pows := StructuralCopy(T.pre.jen.coms[poscom][2]);
524517
pows[pos1] := 1;
525518
pows[pos2] := 1;
526-
pos := PosNonzero(pows);
519+
pos := PositionNonZero(pows);
527520
pows := pows{pos};
528521
combs := Combinations([1..Length(pos)]);
529522
v := [ ];
@@ -591,7 +584,7 @@ end);
591584
# Input: Table and maximal weight we want. Typically output from PreSet
592585
# Output: None. T.powwords, T.commwords, T.dim, T.wgs are set
593586
BindGlobal("WordFillTable", function(T, lvl)
594-
local F, p, s1, l, i, pos1, expw1, w1, sortweights1, sortexpw1, f1, posf1, s2, post2, expw2, w2, sortweights2, sortexpw2, f2, posf2, dep, mm, vec, posvec, fac1, posnonzero, v;
587+
local F, p, s1, l, i, pos1, expw1, w1, sortweights1, sortexpw1, f1, posf1, s2, post2, expw2, w2, sortweights2, sortexpw2, f2, posf2, dep, mm, vec, posvec, fac1, v;
595588

596589
F := T.fld;
597590
p := Characteristic(F);

gap/grpalg/tabletoalgebraandback.gi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ local k, maxweight, i, lim, sup, coeffs, v0, res, exps, nonzeroexps, sum, S, ini
2424
## for each element g1^e1...gm^em we convert g1^e1...gm^em to an expression in the Jennings basis using the formulas known for this
2525
for i in [1..Size(sup)] do
2626
exps := ExponentsOfPcElement(T.pre.jen.pcgs, sup[i]){[1..lim]};
27-
nonzeroexps := PosNonzero(exps);
27+
nonzeroexps := PositionNonZero(exps);
2828
sum := ShallowCopy(v0);
2929
# run over all supsets of non-zero exponents. Each gives a summand
3030
for S in Combinations( nonzeroexps ) do

0 commit comments

Comments
 (0)