bridge/class-master/depend/pari/src/basemath/FpX_factor.c
/* T must be squarefree mod p*/
T must be squarefree mod p
T must be squarefree mod p
GEN
Flx_nbfact_by_degree(GEN T, long *nb, ulong p)
{
  GEN XP, D;
  pari_timer ti;
  long i, s, n = get_Flx_degree(T);
  GEN V = const_vecsmall(n, 0);
  pari_sp av = avma;
  T = Flx_get_red(T, p);
  if (DEBUGLEVEL>=6) timer_start(&ti);
  XP = Flx_Frobenius(T, p);
  if (DEBUGLEVEL>=6) timer_printf(&ti,"Flx_Frobenius");
  D = Flx_ddf_Shoup(T, XP, p);
  if (DEBUGLEVEL>=6) timer_printf(&ti,"Flx_ddf_Shoup");
  for (i = 1, s = 0; i <= n; i++)
  {
    V[i] = degpol(gel(D,i))/i;
    s += V[i];
  }
  *nb = s;
  avma = av; return V;
}
GEN Flx_nbfact_by_degree ( GEN T , long * nb , ulong p ) { GEN XP , D ; pari_timer ti ; long i , s , n = get_Flx_degree ( T ) ; GEN V = const_vecsmall ( n , 0 ) ; pari_sp av = avma ; T = Flx_get_red ( T , p ) ; if ( DEBUGLEVEL >= 6 ) timer_start ( & ti ) ; XP = Flx_Frobenius ( T , p ) ; if ( DEBUGLEVEL >= 6 ) timer_printf ( & ti , " " ) ; D = Flx_ddf_Shoup ( T , XP , p ) ; if ( DEBUGLEVEL >= 6 ) timer_printf ( & ti , " " ) ; for ( i = 1 , s = 0 ; i <= n ; i ++ ) { V [ i ] = degpol ( gel ( D , i ) ) / i ; s += V [ i ] ; } * nb = s ; avma = av ; return V ; }
T must be squarefree mod p
T must be squarefree mod p