bridge/class-master/depend/pari/src/modules/krasner.c
/* See padicfields for the meaning of flag */
See padicfields for the meaning of flag
See padicfields for the meaning of flag
static GEN
GetRamifiedPol(GEN p, GEN efj, long flag)
{
  long e = efj[1], f = efj[2], j = efj[3], i, l;
  const long v = 1;
  GEN L, pols;
  KRASNER_t data;
  pari_sp av = avma;
  if (DEBUGLEVEL>1)
    err_printf("  Computing extensions with decomposition [e, f, j] = [%ld, %ld, %ld]\n", e,f,j);
  data.p   = p;
  data.e   = e;
  data.f   = f;
  data.j   = j;
  data.a   = j/e;
  data.b   = j%e;
  data.c   = (e+2*j)/e+1;
  data.q   = powiu(p, f);
  data.qm1 = subiu(data.q, 1);
  data.v   = v;
  data.r   = 1 + (long)ceildivuu(2*j + 3, e); 
  data.pr  = powiu(p, data.r);
  data.nbext = NumberExtensions(&data);
  if (flag == 2) return data.nbext;
  setUnramData(&data);
  if (DEBUGLEVEL>1)
    err_printf("  Unramified part %Ps\n", data.T);
  data.roottable = NULL;
  if (j)
  {
    if (lgefint(data.q) == 3)
    {
      ulong npol = upowuu(data.q[2], e+1);
      if (npol && npol < (1<<19)) data.roottable = const_vec(npol, NULL);
    }
    data.pk = get_pk(&data);
    L = WildlyRamifiedCase(&data);
  }
  else
    L = TamelyRamifiedCase(&data);
  pols = cgetg_copy(L, &l);
  if (flag == 1)
  {
    GEN E = utoipos(e), F = utoipos(f), D = utoi(f*(e+j-1));
    for (i = 1; i < l; i++)
    {
      GEN T = gel(L,i);
      gel(pols, i) = mkvec5(ZX_copy(gel(T, 1)), E,F,D, icopy(gel(T, 2)));
    }
  }
  else
  {
    for (i = 1; i < l; i++)
    {
      GEN T = gel(L,i);
      gel(pols, i) = ZX_copy(gel(T,1));
    }
  }
  return gerepileupto(av, pols);
}
static GEN GetRamifiedPol ( GEN p , GEN efj , long flag ) { long e = efj [ 1 ] , f = efj [ 2 ] , j = efj [ 3 ] , i , l ; const long v = 1 ; GEN L , pols ; KRASNER_t data ; pari_sp av = avma ; if ( DEBUGLEVEL > 1 ) err_printf ( " \n " , e , f , j ) ; data . p = p ; data . e = e ; data . f = f ; data . j = j ; data . a = j / e ; data . b = j % e ; data . c = ( e + 2 * j ) / e + 1 ; data . q = powiu ( p , f ) ; data . qm1 = subiu ( data . q , 1 ) ; data . v = v ; data . r = 1 + ( long ) ceildivuu ( 2 * j + 3 , e ) ; data . pr = powiu ( p , data . r ) ; data . nbext = NumberExtensions ( & data ) ; if ( flag == 2 ) return data . nbext ; setUnramData ( & data ) ; if ( DEBUGLEVEL > 1 ) err_printf ( " \n " , data . T ) ; data . roottable = NULL ; if ( j ) { if ( lgefint ( data . q ) == 3 ) { ulong npol = upowuu ( data . q [ 2 ] , e + 1 ) ; if ( npol && npol < ( 1 << 19 ) ) data . roottable = const_vec ( npol , NULL ) ; } data . pk = get_pk ( & data ) ; L = WildlyRamifiedCase ( & data ) ; } else L = TamelyRamifiedCase ( & data ) ; pols = cgetg_copy ( L , & l ) ; if ( flag == 1 ) { GEN E = utoipos ( e ) , F = utoipos ( f ) , D = utoi ( f * ( e + j - 1 ) ) ; for ( i = 1 ; i < l ; i ++ ) { GEN T = gel ( L , i ) ; gel ( pols , i ) = mkvec5 ( ZX_copy ( gel ( T , 1 ) ) , E , F , D , icopy ( gel ( T , 2 ) ) ) ; } } else { for ( i = 1 ; i < l ; i ++ ) { GEN T = gel ( L , i ) ; gel ( pols , i ) = ZX_copy ( gel ( T , 1 ) ) ; } } return gerepileupto ( av , pols ) ; }
See padicfields for the meaning of flag
See padicfields for the meaning of flag
/* enough precision */