//
// Table 1 of the article
//

Attach("absfact.m");
import "absfact.m": absfact_random_example, absfact_print_with_moduli;

SetVerbose("AbsoluteFactorization",4);

K:=GF(754974721);
MP<x,y>:= PolynomialRing(K,2);

range:= [3..8];
TODO1:= [ [2^i,1] : i in range];
TODO2:= [ [2^(i-1),2] : i in range];
TODO3:= [ [2^(i - (i div 2)),2^(i div 2)] : i in range];
TODO4:= [ [2,2^(i-1)] : i in range];
TODO5:= [ [1,2^i] : i in range];

TODO:= [TODO1, TODO2, TODO3, TODO4, TODO5];

for T in TODO do
for z in T do
  "Building test ", z;
  F:= absfact_random_example(MP,z[1],z[2],10^9);
  "Factoring...";
  ResetMaximumMemoryUsage();
  ShowMemoryUsage();
  time Ft,u:= AbsoluteFactorization(F);
  ShowMemoryUsage();
  "MaximumMemoryUsage (MB): ", GetMaximumMemoryUsage()/ 1024.0^2 ;
end for;
end for;

quit;
