Skip to content

Commit 370a093

Browse files
committed
Tweak PartialFactorization call when proving primality
Namely, by passing it the 'cheap' option (which implies the FactIntPartial option), as the surrounding code would suggest. This makes calling e.g. IsPrimeInt(100000000000000000000000000000000000000000000000151); with FactInt loaded almost as fast as without it loaded.
1 parent ea17f8b commit 370a093

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

hpcgap/lib/primality.gi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,8 @@ function(N)
580580
# try straightforward method first
581581
if cheap=true and FactIntPartial=true then
582582
to_check:=Concatenation(
583-
List(Set(PartialFactorization(N-1,7)),p->["F",p]),
584-
List(Set(PartialFactorization(N+1,7)),p->["L",p]));
583+
List(Set(PartialFactorization(N-1,7 : cheap)),p->["F",p]),
584+
List(Set(PartialFactorization(N+1,7 : cheap)),p->["L",p]));
585585
if [] <> PrimalityProof_VerifyStructure(N,to_check)
586586
then return to_check;
587587
else Info(InfoPrimeInt,1,"Straightforward Fermat-Lucas primality proof failed on ",N);

lib/primality.gi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,8 @@ function(N)
580580
# try straightforward method first
581581
if cheap=true and FactIntPartial=true then
582582
to_check:=Concatenation(
583-
List(Set(PartialFactorization(N-1,7)),p->["F",p]),
584-
List(Set(PartialFactorization(N+1,7)),p->["L",p]));
583+
List(Set(PartialFactorization(N-1,7 : cheap)),p->["F",p]),
584+
List(Set(PartialFactorization(N+1,7 : cheap)),p->["L",p]));
585585
if [] <> PrimalityProof_VerifyStructure(N,to_check)
586586
then return to_check;
587587
else Info(InfoPrimeInt,1,"Straightforward Fermat-Lucas primality proof failed on ",N);

0 commit comments

Comments
 (0)