-
Notifications
You must be signed in to change notification settings - Fork 1
/
moreap_loop.cc
64 lines (60 loc) · 2.01 KB
/
moreap_loop.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// FILE moreap_loop.cc: computes more ap for a range of levels
//#include <fstream>
#include "qidloop.h"
#include "newforms.h"
int main(void)
{
cout << "Program moreap: for each level, assumes that the newforms file exists, and computes more Hecke eigenvalues.\n";
cout << "---------------\n\n";
long d,maxpnorm=150000;
cout << "Enter field: " << flush; cin >> d;
Quad::field(d,maxpnorm);
int verbose=0, output=0, showeigs=0, showforms=0, lastp;
cout << "Verbose? "; cin>>verbose;
cout << "Output new eigs to file (1/0)? "; cin>>output;
cout << "Output new eigs to screen (1/0)? "; cin>>showeigs;
cout << "Display newforms (1/0)? "; cin>>showforms;
long firstn, lastn;
int both_conj;
cout<<"Both conjugates? (0/1) "; cin >> both_conj;
cout << "How many primes for Hecke eigenvalues? ";
cin >> lastp; cout << endl;
cout<<"Enter first and last norm for Quads: ";
cin >> firstn >> lastn;
if(firstn<2) firstn=2;
Qidealooper loop(firstn, lastn, 0, 1); // sorted within norm
while( loop.not_finished() )
{
Qideal N = loop.next();
string efilename = eigfile(N);
cout << ">>>> Level " << ideal_label(N) <<" = ("<<gens_string(N)<<"), norm = "<<N.norm()<<" <<<<" << endl;
newforms nf(N,verbose);
nf.read_from_file();
if (showforms) nf.display();
int nnf = nf.n1ds;
if(nnf==0)
{
cout<<"No newforms."<<endl;
continue;
}
int nap = nf.nap;
if(nap>=lastp)
{
cout<<"Already have "<<nap<<" eigenvalues on file, no need to compute more."<<endl;
}
else
{
cout << "Making homspace and bases..."<<endl;
nf.makebases();
cout << "About to start computing ap..."<<endl;
nf.getap(nap+1,lastp,showeigs);
cout << "...done."<<endl;
if(output)
{
cout << "Writing data to file "<<efilename<<"..."<<flush;
nf.output_to_file(efilename);
cout << "...done." << endl;
}
}
} // end of while()
} // end of main()