bridge/class-master/depend/pari/src/basemath/trans3.c
/* initialize the roots of unity for the computation
   of the Teichmuller character (also the values of f and c) */
initialize the roots of unity for the computation
of the Teichmuller character (also the values of f and c)
initialize the roots of unity for the computation of the Teichmuller character ( also the values of f and c )
GEN
init_teich(ulong p, GEN q, long prec)
{
  GEN vz, gp = utoipos(p);
  pari_sp av = avma;
  long j;
  if (p == 2UL)
    return NULL;
  else
  { 
    GEN z, z0 = Zp_sqrtnlift(gen_1, utoipos(p-1), pgener_Fp(gp), gp, prec);
    z = z0;
    vz = cgetg(p, t_VEC);
    for (j = 1; j < (long)p-2; j++)
    {
      gel(vz, umodiu(z, p)) = z; 
      z = modii(mulii(z, z0), q);
    }
    gel(vz, umodiu(z, p)) = z; 
    gel(vz,1) = gen_1; 
  }
  return gerepileupto(av, gcopy(vz));
}
GEN init_teich ( ulong p , GEN q , long prec ) { GEN vz , gp = utoipos ( p ) ; pari_sp av = avma ; long j ; if ( p == 2UL ) return NULL ; else { GEN z , z0 = Zp_sqrtnlift ( gen_1 , utoipos ( p - 1 ) , pgener_Fp ( gp ) , gp , prec ) ; z = z0 ; vz = cgetg ( p , t_VEC ) ; for ( j = 1 ; j < ( long ) p - 2 ; j ++ ) { gel ( vz , umodiu ( z , p ) ) = z ; z = modii ( mulii ( z , z0 ) , q ) ; } gel ( vz , umodiu ( z , p ) ) = z ; gel ( vz , 1 ) = gen_1 ; } return gerepileupto ( av , gcopy ( vz ) ) ; }
initialize the roots of unity for the computation
of the Teichmuller character (also the values of f and c)
initialize the roots of unity for the computation of the Teichmuller character ( also the values of f and c )
/* primitive (p-1)-th root of 1 */ /* z = z0^i */ /* z = z0^(p-2) */ /* z0^(p-1) */