bridge/class-master/depend/pari/src/basemath/ellsea.c
/*Finds the eigenvalue of the Frobenius given E, ell odd prime, h factor of the
 *ell-division polynomial, p and tr the possible values for the trace
 *(useful for primes with one root)*/
Finds the eigenvalue of the Frobenius given E, ell odd prime, h factor of the
ell-division polynomial, p and tr the possible values for the trace
(useful for primes with one root)
Finds the eigenvalue of the Frobenius given E ell odd prime h factor of the ell - division polynomial p and tr the possible values for the trace ( useful for primes with one root )
static ulong
find_eigen_value_oneroot(GEN a4, GEN a6, ulong ell, GEN tr, GEN h, GEN T, GEN p)
{
  pari_sp ltop = avma;
  ulong t;
  struct divpolmod_red d;
  GEN f, Dy, Gy;
  h = FqX_get_red(h, T, p);
  Gy = Fq_find_eigen_Frobenius(a4, a6, h, T, p);
  t = Fl_div(tr[1], 2, ell);
  if (t < (ell>>1)) t = ell - t;
  Fq_elldivpolmod_init(&d, a4, a6, t, h, T, p);
  f = Fq_ellyn(&d, t);
  Dy = FqXQ_mul(Gy, gel(f,2), h, T, p);
  if (!gequal(gel(f,1), Dy)) t = ell-t;
  Fq_elldivpolmod_close(&d);
  avma = ltop; return t;
}
static ulong find_eigen_value_oneroot ( GEN a4 , GEN a6 , ulong ell , GEN tr , GEN h , GEN T , GEN p ) { pari_sp ltop = avma ; ulong t ; struct divpolmod_red d ; GEN f , Dy , Gy ; h = FqX_get_red ( h , T , p ) ; Gy = Fq_find_eigen_Frobenius ( a4 , a6 , h , T , p ) ; t = Fl_div ( tr [ 1 ] , 2 , ell ) ; if ( t < ( ell >> 1 ) ) t = ell - t ; Fq_elldivpolmod_init ( & d , a4 , a6 , t , h , T , p ) ; f = Fq_ellyn ( & d , t ) ; Dy = FqXQ_mul ( Gy , gel ( f , 2 ) , h , T , p ) ; if ( ! gequal ( gel ( f , 1 ) , Dy ) ) t = ell - t ; Fq_elldivpolmod_close ( & d ) ; avma = ltop ; return t ; }
Finds the eigenvalue of the Frobenius given E, ell odd prime, h factor of the
ell-division polynomial, p and tr the possible values for the trace
(useful for primes with one root)
Finds the eigenvalue of the Frobenius given E ell odd prime h factor of the ell - division polynomial p and tr the possible values for the trace ( useful for primes with one root )