-
Notifications
You must be signed in to change notification settings - Fork 1
/
makenf_modp.cc
88 lines (85 loc) · 2.48 KB
/
makenf_modp.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#include "qidloop.h"
#include "newforms.h" // which includes quads.h & moddata.h & etc.
#define LOOPER
int main ()
{
long d, maxpnorm(1000);
cerr << "Enter field: " << flush; cin >> d;
if (!check_field(d))
{
cerr<<"field must be one of: "<<valid_fields<<endl;
exit(1);
}
long ch=0;
cerr << "Enter characteristic p (prime): " << flush; cin >> ch;
Quad::field(d,maxpnorm);
Quad::displayfield(cout);
Quad n; int verbose=0;
int startp, stopp;
cerr << "Verbose? "; cin>>verbose;
cerr << "Which primes for Hecke eigenvalues (first#, last#)? ";
cin >> startp >> stopp; cerr << endl;
int nQP = Quadprimes::list.size();
if (stopp>nQP)
{
cerr<<"Reducing last# to "<<nQP<<", the number of Quadprimes initialized"<<endl;
stopp=nQP;
}
int output=1;
cerr << "Output Hecke eigenvalues? (0/1) "; cin >> output;
#ifdef LOOPER
long firstn, lastn;
int both_conj;
cerr<<"Both conjugates? (0/1) "; cin >> both_conj;
cerr<<"Enter first and last norm for Quads: ";
cin >> firstn >> lastn;
stringstream dimtabfilename;
dimtabfilename << "dimtabeis."<<d<<"."<<firstn<<"-"<<lastn;
if (ch>0)
dimtabfilename << ".mod_"<<ch;
ofstream dimtab(dimtabfilename.str().c_str());
Qidealooper loop(firstn, lastn, both_conj, 1); // sorted within norm
while( loop.not_finished() )
{
Qideal N = loop.next();
#else
Qideal N;
while(cerr<<"Enter level (ideal label or generator): ", cin>>N, !N.is_zero())
{
#endif
INT normN = N.norm();
string efilename = eigfile(N, ch);
string label = ideal_label(N);
cout << ">>>> Level " << label <<" = "<<gens_string(N)<<", norm = "<<normN<<" <<<<" << endl;
newforms nf(N,verbose, ch);
nf.find();
#ifdef LOOPER
int dimcusp, dimeis, dimall;
// output lines as in dimtabeis:
dimtab << d << "\t2\t"; // field and weight
dimtab << label<<"\t\t"; // level and norm
dimcusp = nf.h1->h1cuspdim();
dimall = nf.h1->h1dim();
dimeis = dimall-dimcusp;
dimtab << dimall << "\t\t"
<< dimcusp << "\t\t"
<< dimeis << endl;
#endif
//nf.display();
nf.getap(startp,stopp,verbose);
//cout << "After sort_lmfdb():\n";
nf.sort_lmfdb();
nf.display(verbose);
if(output)
{
cout << "Writing data to file "<<efilename<<"..."<<flush;
nf.output_to_file(efilename);
cout << "done." << endl;
}
cout<<"==========================================="<<endl;
}
cout<<endl;
#ifdef LOOPER
dimtab.close();
#endif
}