Skip to content

Commit

Permalink
Fixed a bug reported on Nov 12, 2021.
Browse files Browse the repository at this point in the history
Fixed a bug reported on Nov 12, 2021 (MPQS running out of polynomials for some number) -- use CFRAC instead if that happens.
  • Loading branch information
Stefan-Kohl authored Apr 7, 2024
1 parent ade686d commit d5a4a4a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/mpqs.gi
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,15 @@ BindGlobal("MPQSSplit", function (n)
if PolyCount > 0 then
i := NraFactors;
while aFactorsSelectedPositions[i]
= aFactorsPoolsize - (NraFactors - i) do i := i - 1; od;
= aFactorsPoolsize - (NraFactors - i)
do
i := i - 1;
if i = 0 then
Info(IntegerFactorizationInfo,2,
"The MPQS ran out of polynomials, using CFRAC instead.");
return CFRACSplit(n/Multiplier);
fi;
od;
aFactorsSelectedPositions[i] := aFactorsSelectedPositions[i] + 1;
for j in [i + 1..NraFactors] do
aFactorsSelectedPositions[j] :=
Expand Down Expand Up @@ -552,4 +560,4 @@ end);

#############################################################################
##
#E mpqs.gi . . . . . . . . . . . . . . . . . . . . . . . . . . . ends here
#E mpqs.gi . . . . . . . . . . . . . . . . . . . . . . . . . . . ends here

0 comments on commit d5a4a4a

Please sign in to comment.