@@ -326,14 +326,16 @@ CurveRed::CurveRed(const Curvedata& E)
326326 N = one;
327327 for ( const auto & ri : reduct_array)
328328 N *= pow ((ri.first ), (ri.second ).ord_p_N );
329+ for (auto p: the_bad_primes)
330+ setLocalRootNumber (p);
329331 return ;
330332} // end of Tate's algorithm
331333
332334// Sort key for sorting lists of curves (LMFDB ordering):
333335// (1) conductor
334336// (2) list of ap for p < NP_SORT
335337// (3) a1,a2,a3,4,a6
336- vector<bigint> CurveRed::sort_key (const int NP_SORT)
338+ vector<bigint> CurveRed::sort_key (const int NP_SORT) const
337339{
338340 vector<bigint> key;
339341 key.push_back (N);
@@ -350,7 +352,7 @@ vector<bigint> CurveRed::sort_key(const int NP_SORT)
350352
351353// The local Tamagawa exponent -- same as Tamagawa number unless the
352354// component group is (2,2). Use p=0 for reals
353- bigint local_Tamagawa_exponent (CurveRed& c, const bigint& p)
355+ bigint local_Tamagawa_exponent (const CurveRed& c, const bigint& p)
354356{
355357 static const bigint one (1 ), two (2 ), four (4 );
356358 if (is_zero (p)) return bigint (c.conncomp );
@@ -406,39 +408,39 @@ vector<long> tamagawa_primes(const CurveRed& C, int real_too)
406408// which is impossible without removing the "const" qualifier from the
407409// CurveRed argument!
408410
409- int CurveRed::ord_p_discr (const bigint& p)
411+ int CurveRed::ord_p_discr (const bigint& p) const
410412{
411413 auto ri = reduct_array.find (p);
412414 return (ri==reduct_array.end ()? 0 : (ri->second ).ord_p_discr );
413415}
414416
415- int CurveRed::ord_p_N (const bigint& p)
417+ int CurveRed::ord_p_N (const bigint& p) const
416418{
417419 auto ri = reduct_array.find (p);
418420 return (ri==reduct_array.end ()? 0 : (ri->second ).ord_p_N );
419421}
420422
421- int CurveRed::ord_p_j_denom (const bigint& p)
423+ int CurveRed::ord_p_j_denom (const bigint& p) const
422424{
423425 auto ri = reduct_array.find (p);
424426 return (ri==reduct_array.end ()? 0 : (ri->second ).ord_p_j_denom );
425427}
426428
427- int CurveRed::c_p (const bigint& p)
429+ int CurveRed::c_p (const bigint& p) const
428430{
429431 auto ri = reduct_array.find (p);
430432 return (ri==reduct_array.end ()? : (ri->second ).c_p );
431433}
432434
433- vector<bigint> CurveRed::all_cp ()
435+ vector<bigint> CurveRed::all_cp () const
434436{
435437 vector<bigint> ans (reduct_array.size ());
436438 std::transform (reduct_array.begin (), reduct_array.end (), ans.begin (),
437439 [] (const pair<bigint,Reduction_type>& x) {return bigint (x.second .c_p );});
438440 return ans;
439441}
440442
441- bigint CurveRed::prodcp ()
443+ bigint CurveRed::prodcp () const
442444{
443445 static const bigint one (1 );
444446 vector<bigint> allcp = all_cp ();
@@ -447,13 +449,13 @@ bigint CurveRed::prodcp()
447449}
448450
449451// The local Tamagawa number. Use p=0 for reals
450- bigint local_Tamagawa_number (CurveRed& c, const bigint& p)
452+ bigint local_Tamagawa_number (const CurveRed& c, const bigint& p)
451453{
452454 return bigint (is_zero (p)? getconncomp (c): getc_p (c,p));
453455}
454456
455457// The global Tamagawa number, = product of local ones.
456- bigint global_Tamagawa_number (CurveRed& c, int real_too)
458+ bigint global_Tamagawa_number (const CurveRed& c, int real_too)
457459{
458460 return bigint (prodcp (c) * (real_too ? getconncomp (c) : 1 ));
459461}
@@ -514,25 +516,19 @@ void CurveRed::display(ostream& os)
514516// Reduction_type::local_root_number field, computing them if not
515517// already set (i.e. field contains 0)
516518
517- int CurveRed::LocalRootNumber (const bigint& p)
519+ int CurveRed::LocalRootNumber (const bigint& p) const
518520{
519521 if (is_zero (p)) return -1 ; // the infinite prime
520522 auto ri = reduct_array.find (p);
521523 if (ri==reduct_array.end ()) return 1 ; // good reduction case
522- if ((ri->second ).local_root_number ==0 )
523- setLocalRootNumber (p);
524524 return (ri->second ).local_root_number ;
525525}
526526
527- int CurveRed::GlobalRootNumber ()
527+ int CurveRed::GlobalRootNumber () const
528528{
529- int ans=-1 ;
529+ int ans=-1 ; // root number at the infinte place (which is real)
530530 for ( const auto & ri : reduct_array)
531- {
532- if ((ri.second ).local_root_number ==0 )
533- setLocalRootNumber (ri.first );
534- ans *= (ri.second ).local_root_number ;
535- }
531+ ans *= (ri.second ).local_root_number ;
536532 return ans;
537533}
538534
@@ -1041,7 +1037,7 @@ int CurveRed::neron(long p, int kod)
10411037
10421038// Trace of Frobenius (via pari) if p good
10431039// (or 0 for additive reduction, +1 for split multiplicative, -1 for nonsplit)
1044- long CurveRed::ap (long p)
1040+ long CurveRed::ap (long p) const
10451041{
10461042 bigint P (p);
10471043 int f = min (2 , ord_p_N (P));
@@ -1058,7 +1054,7 @@ long CurveRed::ap(long p)
10581054
10591055// Trace of Frobenius (via pari) if p good
10601056// (or 0 for additive reduction, +1 for split multiplicative, -1 for nonsplit)
1061- bigint CurveRed::ap (const bigint& p)
1057+ bigint CurveRed::ap (const bigint& p) const
10621058{
10631059 if (is_long (p))
10641060 return bigint (ap (I2long (p)));
0 commit comments