1 // FILE moreap.cc: computes more ap for given level(s)
2 //////////////////////////////////////////////////////////////////////////
3 //
4 // Copyright 1990-2012 John Cremona
5 //
6 // This file is part of the eclib package.
7 //
8 // eclib is free software; you can redistribute it and/or modify it
9 // under the terms of the GNU General Public License as published by the
10 // Free Software Foundation; either version 2 of the License, or (at your
11 // option) any later version.
12 //
13 // eclib is distributed in the hope that it will be useful, but WITHOUT
14 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16 // for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with eclib; if not, write to the Free Software Foundation,
20 // Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 //
22 //////////////////////////////////////////////////////////////////////////
23 #include <fstream>
24 #include <eclib/moddata.h>
25 #include <eclib/symb.h>
26 #include <eclib/cusp.h>
27 #include <eclib/homspace.h>
28 #include <eclib/oldforms.h>
29 #include <eclib/cperiods.h>     //from qcurves, for computing conductors
30 #include <eclib/newforms.h>
31 
32 //#define AUTOLOOP
33 
main(void)34 int main(void)
35 {
36  int n=1;
37  int lastn, stopp, output, showeigs, showforms, findcurves;
38  int nnf, nap;
39  cout << "Program moreap\n";
40  cout << "---------------\n\n";
41  cout << "For each N, assumes that the file newforms/xN exists, and computes more\n";
42  cout << "Hecke eigenvalues.\n";
43  cout << "Output new eigs to file (1/0)? ";  cin>>output;
44  cout << "Output new eigs to screen (1/0)? "; cin>>showeigs;
45  cout << "Display newforms (1/0)? "; cin>>showforms;
46  cout << "Attempt curve construction (1/0)? "; cin>>findcurves;
47 #ifdef MPFP
48  if(findcurves) set_precision(60);
49 #endif
50 #ifdef AUTOLOOP
51  cout << "How many primes for Hecke eigenvalues? ";
52  cin  >> stopp; cout << endl;
53  cout<<"Enter first and last N: ";cin>>n>>lastn; n--;
54  while (n<lastn) { n++;
55 #else
56  while (cout<<"Enter level: ", cin>>n, n>0) {
57  cout << "How many primes for Hecke eigenvalues? ";
58  cin  >> stopp; cout << endl;
59 #endif
60   cout << "\n>>>Level " << n << "\t";
61   newforms nf(n,showforms);
62   nf.createfromdata(1,0,0);
63   if (showforms) nf.newforms::display();
64 
65   nnf = nf.n1ds;
66   if(nnf==0)
67     {
68       cout<<"No newforms."<<endl;
69       continue;
70     }
71   nap = nf.nflist[0].aplist.size();
72   if(nap>=stopp)
73     {
74       cout<<"Already have "<<nap<<" eigenvalues on file, no need to compute more."<<endl;
75     }
76   else
77     {
78       nf.makebases(1);
79       cout << "About to start computing ap..."<<flush;
80       nf.make_projcoord();
81       nf.find_jlist();
82       nf.addap(stopp);
83       cout << "...done."<<endl;
84       if(output) nf.output_to_file();
85     }
86   if(findcurves)
87     {
88       int inf, nnf = nf.n1ds;
89       // Now we compute the curves
90       cout<<"Computing "<<nnf<<" curves...\n";
91       vector<int> forms;
92       for(inf=0; inf<nnf; inf++) forms.push_back(inf);
93       vector<int> failures = nf.showcurves(forms,0,"no");
94       if(failures.size()>0)
95 	{
96 	  cout<<"No curve found for "<<failures.size()<<" forms: "<<failures<<endl;
97 	}
98       else
99 	{
100 	  cout<<"All curves found OK"<<endl;
101 	}
102     }
103 }       // end of while()
104 }       // end of main()
105