bridge/class-master/depend/pari/src/modules/krasner.c
/* return a minimal list of polynomials generating all the totally
   ramified extensions of K^ur of degree e and discriminant
   p^{e + j - 1} in the tamely ramified case */
return a minimal list of polynomials generating all the totally
ramified extensions of K^ur of degree e and discriminant
p^{e + j - 1} in the tamely ramified case
return a minimal list of polynomials generating all the totally ramified extensions of K^ur of degree e and discriminant p^ { e + j - 1 } in the tamely ramified case
static GEN
TamelyRamifiedCase(KRASNER_t *data)
{
  long av = avma;
  long g = ugcdui(data->e, data->qm1); 
  GEN rep, eis, Xe = gpowgs(pol_x(0), data->e), m = stoi(data->e / g);
  rep = zerovec(g);
  eis = gadd(Xe, data->p);
  gel(rep, 1) = mkvec2(get_topx(data,eis), m);
  if (g > 1)
  {
    ulong pmodg = umodiu(data->p, g);
    long r = 1, ct = 1;
    GEN sv = InitSieve(g-1);
    while (r)
    {
      long gr;
      GEN p1 = (typ(data->u) == t_INT)?
        mulii(Fp_powu(data->u, r, data->p), data->p):
        ZX_Z_mul(FpXQ_powu(data->u, r, data->T, data->p), data->p);
      eis = gadd(Xe, p1); 
      ct++;
      gel(rep, ct) = mkvec2(get_topx(data,eis), m);
      gr = r;
      do { SetSieveValue(sv, gr); gr = Fl_mul(gr, pmodg, g); } while (gr != r);
      r  = NextZeroValue(sv, r);
    }
    setlg(rep, ct+1);
  }
  return gerepilecopy(av, rep);
}
static GEN TamelyRamifiedCase ( KRASNER_t * data ) { long av = avma ; long g = ugcdui ( data -> e , data -> qm1 ) ; GEN rep , eis , Xe = gpowgs ( pol_x ( 0 ) , data -> e ) , m = stoi ( data -> e / g ) ; rep = zerovec ( g ) ; eis = gadd ( Xe , data -> p ) ; gel ( rep , 1 ) = mkvec2 ( get_topx ( data , eis ) , m ) ; if ( g > 1 ) { ulong pmodg = umodiu ( data -> p , g ) ; long r = 1 , ct = 1 ; GEN sv = InitSieve ( g - 1 ) ; while ( r ) { long gr ; GEN p1 = ( typ ( data -> u ) == t_INT ) ? mulii ( Fp_powu ( data -> u , r , data -> p ) , data -> p ) : ZX_Z_mul ( FpXQ_powu ( data -> u , r , data -> T , data -> p ) , data -> p ) ; eis = gadd ( Xe , p1 ) ; ct ++ ; gel ( rep , ct ) = mkvec2 ( get_topx ( data , eis ) , m ) ; gr = r ; do { SetSieveValue ( sv , gr ) ; gr = Fl_mul ( gr , pmodg , g ) ; } while ( gr != r ) ; r = NextZeroValue ( sv , r ) ; } setlg ( rep , ct + 1 ) ; } return gerepilecopy ( av , rep ) ; }
return a minimal list of polynomials generating all the totally
ramified extensions of K^ur of degree e and discriminant
p^{e + j - 1} in the tamely ramified case
return a minimal list of polynomials generating all the totally ramified extensions of K^ur of degree e and discriminant p^ { e + j - 1 } in the tamely ramified case
/* (e, q-1) */ /* let Frobenius act to get a minimal set of polynomials over Q_p */ /* add cst coef */