Skip to content

Commit

Permalink
Bug fix for mwrank with test example added
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnCremona committed Aug 26, 2015
1 parent 89872ca commit aeda5eb
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.65])
AC_INIT([eclib], [20150510], [john.cremona@gmail.com])
AC_INIT([eclib], [20150826], [john.cremona@gmail.com])
AM_INIT_AUTOMAKE([-Wall])
AC_MSG_NOTICE([Configuring eclib...])
AC_CONFIG_SRCDIR([libsrc])
Expand Down
2 changes: 1 addition & 1 deletion libsrc/eclib/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#define DEFAULT_VERBOSE 1
#define DEFAULT_PRECISION 15
#define DEFAULT_HLIMQ 10
#define DEFAULT_NAUX 8
#define DEFAULT_NAUX 15
#define DEFAULT_HLIMC 0
#define DEFAULT_TRACEEQUIV 0
#define DEFAULT_PTL -99 // if not set manually will be set to same as verbose
Expand Down
32 changes: 17 additions & 15 deletions libsrc/mrank1.cc
Original file line number Diff line number Diff line change
Expand Up @@ -645,13 +645,13 @@ void rank1::getquartics1()
static bigint zero = BIGINT(0);
IJ_curve = Curvedata(zero,zero,zero,-27*ii,-27*jj,0); // don't minimise

if (posdisc)
if (posdisc)
{
gettype(2); // get type 2s first as they are a subgroup of index 1 or 2
if(!have_eggpoint)
if(!(have_eggpoint || have_large_quartics))
gettype(1);
}
else
}
else
{
gettype(3);
}
Expand Down Expand Up @@ -1401,12 +1401,12 @@ rank1::rank1(Curvedata* ec, int verb, int sel, long lim1, long lim2,long n_aux)
long e0,e1,e2;
if(!intlog2(n0,e0,0))
{
success=0;
cout<<"!!! Fatal error: n0=#E[2]="<<n0<<" is not a power of 2\n";
cout<<"Please inform author by email!\n";
success=0;
cout<<"\n\n!!! Fatal error in mwrank: n0=#E[2]="<<n0<<" is not a power of 2\n";
cout<<"This is a bug: please report!\n";
return;
}

posdisc = is_positive(d1728);
npoints1=npoints2=0;
n1=n2=1;
Expand Down Expand Up @@ -1461,7 +1461,9 @@ rank1::rank1(Curvedata* ec, int verb, int sel, long lim1, long lim2,long n_aux)
long keep_n3 = n3, e3;
if (!intlog2(n3,e3,1))
{
cout<<"\n!!! n3 = "<<keep_n3<<" not a power of 2, rounding up to "<<n3<<"\n";
success=0;
cout<<"\n\n!!! Fatal error in mwrank: n3 ="<<keep_n3<<" not a power of 2\n";
cout<<"This is a bug: please report!\n";
}
long selmer_rank_B = rank_B + e3;

Expand All @@ -1473,7 +1475,7 @@ rank1::rank1(Curvedata* ec, int verb, int sel, long lim1, long lim2,long n_aux)
if(!selmer_only)
cout << "Sha rank contribution from B=im(eps) = " << e3 << endl;
}

long keep_n1=n1, keep_n2=n2;
if (!intlog2(n1,e1,1))
{
Expand All @@ -1485,13 +1487,13 @@ rank1::rank1(Curvedata* ec, int verb, int sel, long lim1, long lim2,long n_aux)
}
if (!intlog2(n2,e2,0))
{
success=0;
cout<<"\n\n!!! Fatal error: n2 = "<<keep_n2<<" not a power of 2\n";
cout<<"Please inform author by email!\n";
success=0;
cout<<"\n\n!!! Fatal error in eclib: n2 = "<<keep_n2<<" not a power of 2\n";
cout<<"This is a bug: please report!\n";
}

long rank_A = e1-e0, selmer_rank_A = e2-e0;

if(verbose)
{
if(!selmer_only)
Expand Down
1 change: 1 addition & 0 deletions tests/in/tmrank.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
0 1 0 9910 9815689 8
0 0 0 -6112 12325825 8
1 0 1 34318214642441646362435632562579908747 3184376895814127197244886284686214848599453811643486936756 15
0 0 0 -532 -4374 1

0 0 0 0 0 0
1 change: 1 addition & 0 deletions tests/out/tmrank.out
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ Curve [0,0,0,-6544,7375129] : Rank = 8
Curve [0,1,0,9910,9815689] : Rank = 8
Curve [0,0,0,-6112,12325825] : Rank = 8
Curve [1,0,1,34318214642441646362435632562579908747,3184376895814127197244886284686214848599453811643486936756] : Rank = 15
Curve [0,0,0,-532,-4374] : Rank = 1

0 comments on commit aeda5eb

Please sign in to comment.