Skip to content

Commit fa94fef

Browse files
committed
CLEANUP: Replace calls to FactInt with Factors(Integers,
This way better factorizations methods in packages will get used. (Calls in the recursive implementation of FactInt are kept.) Also replace some calls by `PrimePGroup` etc. (This is a revised version of earlier as there was already a merge with PrimePGroup.) This addresses #2087
1 parent 3a4aba2 commit fa94fef

26 files changed

+66
-66
lines changed

lib/claspcgs.gi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ local G, home, # the group and the home pcgs
606606
cent:=false;
607607

608608
elif IsPrimePowerInt(Size(G)) then
609-
p:=FactorsInt(Size(G))[1];
609+
p:=PrimePGroup(G);
610610
home:=PcgsPCentralSeriesPGroup(G);
611611
eas:=PCentralNormalSeriesByPcgsPGroup(home);
612612

@@ -1107,7 +1107,7 @@ local G, home, # the group and the home pcgs
11071107
(InducedPcgs(home,cl.centralizer), c -> Comm(k, c) in L));
11081108
end;
11091109
elif IsPrimePowerInt(Size(G)) then
1110-
p:=FactorsInt(Size(G))[1];
1110+
p:=PrimePGroup(G);
11111111
home:=PcgsPCentralSeriesPGroup(G);
11121112
eas:=PCentralNormalSeriesByPcgsPGroup(home);
11131113

lib/ctbl.gi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,7 @@ InstallGlobalFunction( CharacterTable_IsNilpotentNormalSubgroup,
12511251
orders:= OrdersClassRepresentatives( tbl );
12521252
ppow:= Filtered( N, i -> IsPrimePowerInt( orders[i] ) );
12531253

1254-
for part in Collected( FactorsInt( Sum( classlengths{ N }, 0 ) ) ) do
1254+
for part in Collected( Factors(Integers, Sum( classlengths{ N }, 0 ) ) ) do
12551255

12561256
# Check whether the Sylow p subgroup of `N' is normal in `N',
12571257
# i.e., whether the number of elements of p-power is equal to
@@ -2903,7 +2903,7 @@ InstallMethod( PrimeBlocksOp,
29032903
if d = ppart then
29042904
d:= 0;
29052905
else
2906-
d:= Length( FactorsInt( ppart / d ) ); # the defect
2906+
d:= Length( Factors(Integers, ppart / d ) ); # the defect
29072907
fi;
29082908
Add( primeblocks.defect, d );
29092909

@@ -4923,7 +4923,7 @@ BindGlobal( "CharacterTableDisplayDefault", function( tbl, options )
49234923
elif centralizers = true then
49244924
Print( "\n" );
49254925
for i in [col..col+acol-1] do
4926-
fak:= FactorsInt( tbl_centralizers[classes[i]] );
4926+
fak:= Factors(Integers, tbl_centralizers[classes[i]] );
49274927
for prime in Set( fak ) do
49284928
cen[prime][i]:= Number( fak, x -> x = prime );
49294929
od;
@@ -5279,8 +5279,8 @@ InstallMethod( CharacterTableDirectProduct,
52795279

52805280
# Compute power maps for all prime divisors of the result order.
52815281
vals_direct:= ComputedPowerMaps( direct );
5282-
for k in Union( FactorsInt( Size( tbl1 ) ),
5283-
FactorsInt( Size( tbl2 ) ) ) do
5282+
for k in Union( Factors(Integers, Size( tbl1 ) ),
5283+
Factors(Integers, Size( tbl2 ) ) ) do
52845284
powermap_k:= [];
52855285
vals1:= PowerMap( tbl1, k );
52865286
vals2:= PowerMap( tbl2, k );

lib/ctblfuns.gi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ InstallMethod( CorrespondingPermutations,
775775
# Note that if we have taken away a union of orbits such that the
776776
# number of remaining points is smaller than the smallest prime
777777
# divisor of the order of `g' then all these points must be fixed.
778-
min:= FactorsInt( Order( g ) )[1];
778+
min:= Factors(Integers, Order( g ) )[1];
779779
images:= [];
780780

781781
for list in part do
@@ -942,7 +942,7 @@ InstallOtherMethod( CorrespondingPermutations,
942942
# Note that if we have taken away a union of orbits such that the
943943
# number of remaining points is smaller than the smallest prime
944944
# divisor of the order of `g' then all these points must be fixed.
945-
min:= FactorsInt( Order( g ) )[1];
945+
min:= Factors(Integers, Order( g ) )[1];
946946
images:= [];
947947

948948
for list in part do

lib/ctblmaps.gi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ InstallOtherMethod( PowerMapOp,
167167
fi;
168168

169169
image:= class;
170-
for i in FactorsInt( n ) do
170+
for i in Factors(Integers, n ) do
171171
# Here we use that `n' is a small integer.
172172
if not IsBound( powermap[i] ) then
173173

@@ -3368,7 +3368,7 @@ InstallGlobalFunction( ConsiderSmallerPowerMaps, function( arg )
33683368

33693369
for i in omega do
33703370

3371-
factors:= FactorsInt( prime mod tbl_orders[i] );
3371+
factors:= Factors(Integers, prime mod tbl_orders[i] );
33723372
if factors = [ 1 ] or factors = [ 0 ] then factors:= []; fi;
33733373

33743374
if ForAll( Set( factors ), x -> IsBound( tbl_powermap[x] ) ) then

lib/ctblmono.gi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ InstallMethod( IsMonomialNumber,
939939
pair2, # loop over `collect'
940940
ord; # multiplicative order
941941

942-
factors := FactorsInt( n );
942+
factors := Factors(Integers, n );
943943
collect := Collected( factors );
944944

945945
# Get $\nu_2(n)$.
@@ -1106,7 +1106,7 @@ InstallMethod( TestMonomialQuick,
11061106
if IsSolvableGroup( G ) then
11071107

11081108
pi := PrimeDivisors( codegree );
1109-
hall := Product( Filtered( FactorsInt( factsize ), x -> x in pi ), 1 );
1109+
hall := Product( Filtered( Factors(Integers, factsize ), x -> x in pi ), 1 );
11101110

11111111
if factsize / hall = chi[1] then
11121112

@@ -1957,7 +1957,7 @@ InstallMethod( IsMinimalNonmonomial,
19571957
factsize:= Index( K, F );
19581958

19591959
# The Fitting subgroup of a minimal nomonomial group is a $p$-group.
1960-
facts:= FactorsInt( Size( F ) );
1960+
facts:= Factors(Integers, Size( F ) );
19611961
p:= Set( facts );
19621962
if 1 < Length( p ) then
19631963
return false;

lib/ctblpope.gi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1888,7 +1888,7 @@ InstallGlobalFunction( PermCandidatesFaithful,
18881888
od;
18891889
# `primes': prime divisors of $|U|$ for which there is only one $G$-family
18901890
# of that element order in $UN$:
1891-
factors:= FactorsInt( tbl_size / torso[1] );
1891+
factors:= Factors(Integers, tbl_size / torso[1] );
18921892
primes:= Set( factors );
18931893
orbits:= List( primes, p -> [] );
18941894
for i in [ 1 .. nccl ] do

lib/cyclotom.gi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ InstallGlobalFunction( CoeffsCyc, function( z, N )
264264
# must be equal, and the negative of this value is put at the
265265
# position of the $p$-th element of this congruence class.
266266
if second > 1 then
267-
for p in FactorsInt( second ) do
267+
for p in Factors(Integers, second ) do
268268
nn:= n / p;
269269
newcoeffs:= ListWithIdenticalEntries( nn, 0 );
270270
for k in [ 1 .. n ] do
@@ -1245,7 +1245,7 @@ InstallGlobalFunction( Quadratic, function( arg )
12451245
fi;
12461246

12471247
coeffs:= ExtRepOfObj( cyc );
1248-
facts:= FactorsInt( Length( coeffs ) );
1248+
facts:= Factors(Integers, Length( coeffs ) );
12491249
factsset:= Set( facts );
12501250
two_part:= Number( facts, x -> x = 2 );
12511251

lib/ffe.gi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ InstallMethod( Order,
819819
p := Characteristic(z);
820820
d := DegreeFFE(z);
821821
ord := p^d-1;
822-
facs := Collected(FactorsInt(ord));
822+
facs := Collected(Factors(Integers,ord));
823823
for f in facs do
824824
for i in [1..f[2]] do
825825
o := ord/f[1];

lib/ffeconway.gi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ FFECONWAY.WriteOverSmallestField := function(x)
518518
return x![3];
519519
fi;
520520
d := x![2];
521-
f := Collected(FactorsInt(d));
521+
f := Collected(Factors(Integers,d));
522522
for fac in f do
523523
l := fac[1];
524524
d1 := d/l;
@@ -1355,7 +1355,7 @@ FFECONWAY.DoLogFFE :=
13551355
fi;
13561356

13571357
# use rho method
1358-
f:=FactorsInt(q-1:quiet); # Quick factorization, don't stop if its too hard
1358+
f:=Factors(Integers,q-1:quiet); # Quick factorization, don't stop if its too hard
13591359
return FFECONWAY.DoLogFFERho(y,z,q-1,f,q);
13601360
end;
13611361

@@ -1392,7 +1392,7 @@ InstallMethod( Order,
13921392
p := Characteristic(z);
13931393
d := DegreeFFE(z);
13941394
ord := p^d-1;
1395-
facs := Collected(FactorsInt(ord));
1395+
facs := Collected(Factors(Integers,ord));
13961396
for f in facs do
13971397
for i in [1..f[2]] do
13981398
o := ord/f[1];

lib/fldabnum.gi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ InstallGlobalFunction( ZumbroichBase, function( n, m )
823823
Error( "<m> must be a divisor of <n>" );
824824
fi;
825825

826-
factsn:= FactorsInt( n );
826+
factsn:= Factors(Integers, n );
827827
primes:= Set( factsn );
828828
exponsn:= List( primes, x -> 0 ); # Product(List( [1..Length(primes)],
829829
# x->primes[i]^exponsn[i]))=n
@@ -837,7 +837,7 @@ InstallGlobalFunction( ZumbroichBase, function( n, m )
837837
exponsn[ pos ]:= exponsn[ pos ] + 1;
838838
od;
839839

840-
factsm:= FactorsInt( m );
840+
factsm:= Factors(Integers, m );
841841
exponsm:= List( primes, x -> 0 ); # Product(List( [1..Length(primes)],
842842
# x->primes[i]^exponsm[i]))=m
843843
if m <> 1 then
@@ -960,7 +960,7 @@ InstallGlobalFunction( LenstraBase, function( n, stabilizer, supergroup, m )
960960
m:= m / 2;
961961
fi;
962962

963-
factors := FactorsInt( n );
963+
factors := Factors(Integers, n );
964964
primes := Set( factors );
965965
coprimes := Filtered( primes, x -> m mod x <> 0 );
966966
nprime := Product( Filtered( factors, x -> m mod x <> 0 ) );

0 commit comments

Comments
 (0)