bridge/class-master/depend/pari/src/basemath/base2.c
/* assume f a ZX with leading_coeff 1, degree > 0 */
assume f a ZX with leading_coeff 1, degree > 0
assume f a ZX with leading_coeff 1 degree > 0
GEN
ZpX_monic_factor(GEN f, GEN p, long prec)
{
  GEN poly, ex, P, E;
  long l, i;
  if (degpol(f) == 1) return mkmat2(mkcol(f), mkcol(gen_1));
  poly = ZX_squff(f,&ex); l = lg(poly);
  P = cgetg(l, t_VEC);
  E = cgetg(l, t_VEC);
  for (i = 1; i < l; i++)
  {
    GEN L = ZpX_monic_factor_squarefree(gel(poly,i), p, prec);
    gel(P,i) = L; settyp(L, t_COL);
    gel(E,i) = const_col(lg(L)-1, utoipos(ex[i]));
  }
  return mkmat2(shallowconcat1(P), shallowconcat1(E));
}
GEN ZpX_monic_factor ( GEN f , GEN p , long prec ) { GEN poly , ex , P , E ; long l , i ; if ( degpol ( f ) == 1 ) return mkmat2 ( mkcol ( f ) , mkcol ( gen_1 ) ) ; poly = ZX_squff ( f , & ex ) ; l = lg ( poly ) ; P = cgetg ( l , t_VEC ) ; E = cgetg ( l , t_VEC ) ; for ( i = 1 ; i < l ; i ++ ) { GEN L = ZpX_monic_factor_squarefree ( gel ( poly , i ) , p , prec ) ; gel ( P , i ) = L ; settyp ( L , t_COL ) ; gel ( E , i ) = const_col ( lg ( L ) - 1 , utoipos ( ex [ i ] ) ) ; } return mkmat2 ( shallowconcat1 ( P ) , shallowconcat1 ( E ) ) ; }
assume f a ZX with leading_coeff 1, degree > 0
assume f a ZX with leading_coeff 1 degree > 0