bridge/class-master/depend/pari/src/basemath/galconj.c
/* Let O a set of orbits of roots (see fixedfieldorbits) modulo mod,
 * l | mod and p two prime numbers. Return a vector [sym,s,P] where:
 * sym is a sympol, s is the set of images of sym on O and
 * P is the polynomial with roots s. */
Let O a set of orbits of roots  modulo mod,
l | mod and p two prime numbers. Return a vector [sym,s,P] where:
sym is a sympol, s is the set of images of sym on O and
P is the polynomial with roots s.
Let O a set of orbits of roots modulo mod l | mod and p two prime numbers . Return a vector [ sym s P ] where : sym is a sympol s is the set of images of sym on O and P is the polynomial with roots s .
static GEN
fixedfieldsympol(GEN O, GEN mod, GEN l, GEN p, long v)
{
  pari_sp ltop=avma;
  const long n=(BITS_IN_LONG>>1)-1;
  GEN NS = cgetg(n+1,t_MAT), sym = NULL, W = cgetg(n+1,t_VECSMALL);
  long i, e=1;
  if (DEBUGLEVEL>=4)
    err_printf("FixedField: Size: %ldx%ld\n",lg(O)-1,lg(gel(O,1))-1);
  for (i=1; !sym && i<=n; i++)
  {
    GEN L = sympol_eval_newtonsum(e++, O, mod);
    if (lg(O)>2)
      while (vec_isconst(L)) L = sympol_eval_newtonsum(e++, O, mod);
    W[i] = e-1; gel(NS,i) = L;
    if (sympol_is1to1_lg(NS,i+1))
      sym = fixedfieldsurmer(mod,l,p,v,NS,vecsmall_shorten(W,i));
  }
  if (!sym) pari_err_BUG("fixedfieldsympol [p too small]");
  if (DEBUGLEVEL>=2) err_printf("FixedField: Found: %Ps\n",gel(sym,1));
  return gerepilecopy(ltop,sym);
}
static GEN fixedfieldsympol ( GEN O , GEN mod , GEN l , GEN p , long v ) { pari_sp ltop = avma ; const long n = ( BITS_IN_LONG >> 1 ) - 1 ; GEN NS = cgetg ( n + 1 , t_MAT ) , sym = NULL , W = cgetg ( n + 1 , t_VECSMALL ) ; long i , e = 1 ; if ( DEBUGLEVEL >= 4 ) err_printf ( " \n " , lg ( O ) - 1 , lg ( gel ( O , 1 ) ) - 1 ) ; for ( i = 1 ; ! sym && i <= n ; i ++ ) { GEN L = sympol_eval_newtonsum ( e ++ , O , mod ) ; if ( lg ( O ) > 2 ) while ( vec_isconst ( L ) ) L = sympol_eval_newtonsum ( e ++ , O , mod ) ; W [ i ] = e - 1 ; gel ( NS , i ) = L ; if ( sympol_is1to1_lg ( NS , i + 1 ) ) sym = fixedfieldsurmer ( mod , l , p , v , NS , vecsmall_shorten ( W , i ) ) ; } if ( ! sym ) pari_err_BUG ( " " ) ; if ( DEBUGLEVEL >= 2 ) err_printf ( " \n " , gel ( sym , 1 ) ) ; return gerepilecopy ( ltop , sym ) ; }
Let O a set of orbits of roots (see fixedfieldorbits) modulo mod,
 l | mod and p two prime numbers.
Let O a set of orbits of roots ( see fixedfieldorbits ) modulo mod l | mod and p two prime numbers .