Skip to content

Commit

Permalink
Replace Length(Filtered(...)) by Number(...)
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin authored and ChrisJefferson committed Jan 20, 2018
1 parent b158835 commit 97ce295
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion doc/ref/testconsistency.g
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ for elt in x do
errcount:=errcount+1;
fi;
if elt.name="Meth" then
if Length( Filtered( x, t -> t.attributes.Name=name and t.name in ["Attr","Prop","Oper"] ) ) = 0 then
if Number( x, t -> t.attributes.Name=name and t.name in ["Attr","Prop","Oper"] ) = 0 then
pos:=OriginalPositionDocument(doc[2],elt.start);
Print( pos[1], ":", pos[2], " : ", name, " uses Meth with no matching Oper/Attr/Prop\n" );
errcount:=errcount+1;
Expand Down
2 changes: 1 addition & 1 deletion lib/clas.gi
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ local rcls, cl, mark, rep, c, o, cop, same, sub, pow, p, i, j,closure,
rcls:=[];
cl:=ConjugacyClasses(G);

if Length(Filtered(cl,x->Size(x)<10))<10000 then
if Number(cl,x->Size(x)<10)<10000 then
# trigger for cheap element test
for i in [1..Length(cl)] do
if Size(cl[i])<10 then AsSSortedList(cl[i]);fi;
Expand Down
2 changes: 1 addition & 1 deletion lib/ctblauto.gi
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ InstallMethod( MatrixAutomorphisms,
Info( InfoMatrix, 2,
"MatAutomorphisms: There are ", Length( permutations ),
" families (",
Length( Filtered( permutations, x -> Length(x) =1 ) ),
Number( permutations, x -> Length(x) =1 ),
" trivial)" );

for i in [ 1 .. Length( famreps ) ] do
Expand Down
6 changes: 3 additions & 3 deletions lib/ctblpope.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1494,7 +1494,7 @@ InstallGlobalFunction( PermCandidates,

Info( InfoCharacterTable, 2,
"PermCandidates: unique columns erased, there are ",
Length( Filtered( nonzerocol, x -> x ) ), " columns left,\n",
Number( nonzerocol, x -> x ), " columns left,\n",
"#I the number of constituents is ", Length( matrix ), "." );

# step 3: collapse
Expand Down Expand Up @@ -2018,8 +2018,8 @@ InstallGlobalFunction( PermCandidatesFaithful,
"PermCandidatesFaithful: There are ",
Length( matrix ), " possible constituents,\n",
"#I the number of unknown values is ",
Length( Filtered( [ 1 .. nccl ],
x -> not IsBound( faithful[x] ) ) ),
Number( [ 1 .. nccl ],
x -> not IsBound( faithful[x] ) ),
";\n",
"#I now trying to collapse the matrix" );

Expand Down
4 changes: 2 additions & 2 deletions lib/grp.gi
Original file line number Diff line number Diff line change
Expand Up @@ -4528,7 +4528,7 @@ function( g )
return [ g ];
else
p := f[1];
x := Length( Filtered( f, y -> y = p ) );
x := Number( f, y -> y = p );
q := p ^ x;
r := o / q;
gcd := Gcdex ( q, r );
Expand All @@ -4553,7 +4553,7 @@ function( g, p )
if o = 1 then return g; fi;

f := FactorsInt( o );
x := Length( Filtered( f, x -> x = p ) );
x := Number( f, x -> x = p );
if x = 0 then return g^o; fi;

q := p ^ x;
Expand Down
2 changes: 1 addition & 1 deletion lib/randiso2.gi
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ SplitUpSublistsByFpFunc := function( list )
fi;
od;
Info( InfoRandIso, 2, " Iso: found ", Length(result)," classes incl. ",
Length( Filtered( result, IsRecord ) )," unique groups");
Number( result, IsRecord )," unique groups");
return result;
end;

Expand Down
6 changes: 3 additions & 3 deletions tst/testinstall/pgroups.tst
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,16 @@ true
gap> IsPowerfulPGroup(H);
true
gap> myList:=AllSmallGroups(5^4);;
gap> Length(Filtered(myList,g->IsPowerfulPGroup(g)));
gap> Number(myList,g->IsPowerfulPGroup(g));
9
gap> newList:=AllSmallGroups(5^4);;
gap> for g in newList do
> RankPGroup(g);
> Agemo(g,5);
> od;
gap> Length(Filtered(newList,g->IsPowerfulPGroup(g)));
gap> Number(newList,g->IsPowerfulPGroup(g));
9
gap> myList:=AllSmallGroups(2^4);;
gap> Length(Filtered(myList,g->IsPowerfulPGroup(g)));
gap> Number(myList,g->IsPowerfulPGroup(g));
6
gap> STOP_TEST("pgroups.tst", 1);

0 comments on commit 97ce295

Please sign in to comment.