Skip to content

Commit

Permalink
Revert "Fixing overflow bug"
Browse files Browse the repository at this point in the history
This reverts commit aaa46b7.
  • Loading branch information
assaferan committed Jul 14, 2023
1 parent aaa46b7 commit 24b9b1c
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 141 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@ configure
ltmain.sh
*.sig
Tests/*.sig
.magma-scan
1 change: 0 additions & 1 deletion Tests/MagmaFormula.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ procedure testPariVSMagma(N,k : New := false, OnlyPrimes := false, Prec := 1000)
end if;
cmd := Sprintf("./src/traceALbatch_sta %o %o %o %o %o %o", N, N+1, k, Prec,
OnlyPrimes select 1 else 0, New select 1 else 0);
printf "Running command %o...\n", cmd;
System(cmd);
fname := Sprintf("./data/traces_%o_%o.m", k, N);
r := Read(fname);
Expand Down
32 changes: 14 additions & 18 deletions src/traceAL.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
int main(int argc, char* argv[])
{
GEN al;
long k, N, upto, from, prec, start;
long k, N, upto, from, prec;
int only_primes, newspace;

if ((argc < 5) || (argc > 9))
if ((argc < 5) || (argc > 8))
{
printf("Incorrect number of arguments.\n");
printf("Usage: %s <level> <weight> <num_traces> <new> (<only_primes>) (<start>) (<from> <upto>) \n", argv[0]);
printf("Usage: %s <level> <weight> <num_traces> <new> (<only_primes>) (<from> <upto>) \n", argv[0]);
printf("computes traces of S_k(N)^+ for level N between from and to, weight k and for Hecke operators up to the greatest between the Sturm bound, 30 sqrt(p) and 1000 if not specified.\n");
return -1;
}
Expand All @@ -25,30 +25,26 @@ int main(int argc, char* argv[])
only_primes = 1;
else
only_primes = atoi(argv[5]);
start = 0;
if (argc >= 6) {
start = atoi(argv[5 + (1 - newspace)]);
}
if (argc >= 7 + (1-newspace)) {
from = atoi(argv[6 + (1 - newspace)]);
upto = atoi(argv[7 + (1 - newspace)]);
if (argc >= 6 + (1-newspace)) {
from = atoi(argv[5 + (1 - newspace)]);
upto = atoi(argv[6 + (1 - newspace)]);
}

pari_init(10000000000,2);

time_t start_time = time(NULL);
time_t start = time(NULL);
if (only_primes)
al = traceALprimes(N, k, prec, newspace, start);
al = traceALprimes(N, k, prec, newspace);
else
al = traceALupto(N, k, prec, start);
al = traceALupto(N, k, prec);

printf("single run took %ld seconds\n", time(NULL)-start_time);
printf("single run took %ld seconds\n", time(NULL)-start);
pari_printf("al = %Ps\n", al);

if (argc >= 7 + (1-newspace)) {
from = atoi(argv[6 + (1 - newspace)]);
upto = atoi(argv[7 + (1 - newspace)]);
time_t timing = timeTraceAL(upto, from, k, -1, only_primes, newspace, start);
if (argc >= 6 + (1-newspace)) {
from = atoi(argv[5 + (1 - newspace)]);
upto = atoi(argv[6 + (1 - newspace)]);
time_t timing = timeTraceAL(upto, from, k, -1, only_primes, newspace);
printf("took %ld seconds\n", timing);
}
pari_close_mf();
Expand Down
Loading

0 comments on commit 24b9b1c

Please sign in to comment.