/* Copyright (C) 2021 Alessandro Languasco */ /**************** A. LANGUASCO ******************** ************* COMPUTATION OF THE max |L(1,chi)| MOD q(PRIME) *******/ /***************** Precomputations for the external C program ****************/ \\ \p needed to decide the precision default (format, f) for the floating point {mainMaxLMinL(q)= local(g, g1, minutes, millisec, seconds, elaptimeprecomp, prootfile); default(format , f); \\ print numbers with floating point notation (not E notation) if (!isprime(q) || q==2, print("****** error: q has to be an odd prime ******");return); /* initialization */ prootfile = fileopen("./primroot.res", "w"); filewrite(prootfile,q); gettime(); print("Computing the primitive root for q = ",q, " and saving on file"); g1=znprimroot(q); g=lift(g1); elaptimeprecomp=gettime(); filewrite(prootfile,g); fileclose(prootfile); /* print computation time */ seconds=floor(elaptimeprecomp/1000)%60; minutes=floor(elaptimeprecomp/60000); millisec=elaptimeprecomp- minutes*60000 - seconds*1000; \\print(elaptimeprecomp); print("Primitive root generation time: ", minutes, " min, ", seconds, " sec, ", millisec, " millisec"); print("******************************************"); print("Now we run the computation of the maxminL "); print("******************************************"); } /************************************ gp2c -pmy_ -g mainMaxLMinL.gp >mainMaxLMinL.gp.c mac /usr/bin/gcc -c -o mainMaxLMinL.gp.o -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -fPIC -I\"/usr/local/include\" mainMaxLMinL.gp.c && /usr/bin/gcc -o mainKummer.gp.so -bundle -undefined dynamic_lookup -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -fPIC mainMaxLMinL.gp.o linux /usr/bin/gcc -c -o mainMaxLMinL.gp.o -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -fPIC -I\"/usr/local/include\" mainMaxLMinL.gp.c && /usr/bin/gcc -o mainMaxLMinL.gp.so -shared -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -fPIC -Wl,-shared mainMaxLMinL.gp.o -lc -lm -L/usr/local/lib -lpari *******/