Skip to content

Commit aeda5eb

Browse files
committed
Bug fix for mwrank with test example added
1 parent 89872ca commit aeda5eb

File tree

5 files changed

+21
-17
lines changed

5 files changed

+21
-17
lines changed

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Process this file with autoconf to produce a configure script.
44

55
AC_PREREQ([2.65])
6-
AC_INIT([eclib], [20150510], [[email protected]])
6+
AC_INIT([eclib], [20150826], [[email protected]])
77
AM_INIT_AUTOMAKE([-Wall])
88
AC_MSG_NOTICE([Configuring eclib...])
99
AC_CONFIG_SRCDIR([libsrc])

libsrc/eclib/options.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#define DEFAULT_VERBOSE 1
2828
#define DEFAULT_PRECISION 15
2929
#define DEFAULT_HLIMQ 10
30-
#define DEFAULT_NAUX 8
30+
#define DEFAULT_NAUX 15
3131
#define DEFAULT_HLIMC 0
3232
#define DEFAULT_TRACEEQUIV 0
3333
#define DEFAULT_PTL -99 // if not set manually will be set to same as verbose

libsrc/mrank1.cc

+17-15
Original file line numberDiff line numberDiff line change
@@ -645,13 +645,13 @@ void rank1::getquartics1()
645645
static bigint zero = BIGINT(0);
646646
IJ_curve = Curvedata(zero,zero,zero,-27*ii,-27*jj,0); // don't minimise
647647

648-
if (posdisc)
648+
if (posdisc)
649649
{
650650
gettype(2); // get type 2s first as they are a subgroup of index 1 or 2
651-
if(!have_eggpoint)
651+
if(!(have_eggpoint || have_large_quartics))
652652
gettype(1);
653-
}
654-
else
653+
}
654+
else
655655
{
656656
gettype(3);
657657
}
@@ -1401,12 +1401,12 @@ rank1::rank1(Curvedata* ec, int verb, int sel, long lim1, long lim2,long n_aux)
14011401
long e0,e1,e2;
14021402
if(!intlog2(n0,e0,0))
14031403
{
1404-
success=0;
1405-
cout<<"!!! Fatal error: n0=#E[2]="<<n0<<" is not a power of 2\n";
1406-
cout<<"Please inform author by email!\n";
1404+
success=0;
1405+
cout<<"\n\n!!! Fatal error in mwrank: n0=#E[2]="<<n0<<" is not a power of 2\n";
1406+
cout<<"This is a bug: please report!\n";
14071407
return;
14081408
}
1409-
1409+
14101410
posdisc = is_positive(d1728);
14111411
npoints1=npoints2=0;
14121412
n1=n2=1;
@@ -1461,7 +1461,9 @@ rank1::rank1(Curvedata* ec, int verb, int sel, long lim1, long lim2,long n_aux)
14611461
long keep_n3 = n3, e3;
14621462
if (!intlog2(n3,e3,1))
14631463
{
1464-
cout<<"\n!!! n3 = "<<keep_n3<<" not a power of 2, rounding up to "<<n3<<"\n";
1464+
success=0;
1465+
cout<<"\n\n!!! Fatal error in mwrank: n3 ="<<keep_n3<<" not a power of 2\n";
1466+
cout<<"This is a bug: please report!\n";
14651467
}
14661468
long selmer_rank_B = rank_B + e3;
14671469

@@ -1473,7 +1475,7 @@ rank1::rank1(Curvedata* ec, int verb, int sel, long lim1, long lim2,long n_aux)
14731475
if(!selmer_only)
14741476
cout << "Sha rank contribution from B=im(eps) = " << e3 << endl;
14751477
}
1476-
1478+
14771479
long keep_n1=n1, keep_n2=n2;
14781480
if (!intlog2(n1,e1,1))
14791481
{
@@ -1485,13 +1487,13 @@ rank1::rank1(Curvedata* ec, int verb, int sel, long lim1, long lim2,long n_aux)
14851487
}
14861488
if (!intlog2(n2,e2,0))
14871489
{
1488-
success=0;
1489-
cout<<"\n\n!!! Fatal error: n2 = "<<keep_n2<<" not a power of 2\n";
1490-
cout<<"Please inform author by email!\n";
1490+
success=0;
1491+
cout<<"\n\n!!! Fatal error in eclib: n2 = "<<keep_n2<<" not a power of 2\n";
1492+
cout<<"This is a bug: please report!\n";
14911493
}
1492-
1494+
14931495
long rank_A = e1-e0, selmer_rank_A = e2-e0;
1494-
1496+
14951497
if(verbose)
14961498
{
14971499
if(!selmer_only)

tests/in/tmrank.in

+1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@
2020
0 1 0 9910 9815689 8
2121
0 0 0 -6112 12325825 8
2222
1 0 1 34318214642441646362435632562579908747 3184376895814127197244886284686214848599453811643486936756 15
23+
0 0 0 -532 -4374 1
2324

2425
0 0 0 0 0 0

tests/out/tmrank.out

+1
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ Curve [0,0,0,-6544,7375129] : Rank = 8
2020
Curve [0,1,0,9910,9815689] : Rank = 8
2121
Curve [0,0,0,-6112,12325825] : Rank = 8
2222
Curve [1,0,1,34318214642441646362435632562579908747,3184376895814127197244886284686214848599453811643486936756] : Rank = 15
23+
Curve [0,0,0,-532,-4374] : Rank = 1

0 commit comments

Comments
 (0)