bridge/class-master/depend/pari/src/basemath/galconj.c
/* Compute bound for the coefficients of automorphisms.
 * T a ZX, dn a t_INT denominator or NULL */
Compute bound for the coefficients of automorphisms.
T a ZX, dn a t_INT denominator or NULL
Compute bound for the coefficients of automorphisms . T a ZX dn a t_INT denominator or NULL
GEN
initgaloisborne(GEN T, GEN dn, long prec, GEN *ptL, GEN *ptprep, GEN *ptdis)
{
  GEN L, prep, den, nf, r;
  pari_timer ti;
  if (DEBUGLEVEL>=4) timer_start(&ti);
  T = get_nfpol(T, &nf);
  r = nf ? nf_get_roots(nf) : NULL;
  if (nf &&  precision(gel(r, 1)) >= prec)
    L = embed_roots(r, nf_get_r1(nf));
  else
    L = QX_complex_roots(T, prec);
  if (DEBUGLEVEL>=4) timer_printf(&ti,"roots");
  prep = vandermondeinverseprep(L);
  if (!dn)
  {
    GEN dis, res = RgV_prod(gabs(prep,prec));
    dis = ZX_disc_all(T, 1+expi(ceil_safe(res)));
    den = indexpartial(T,dis);
    if (ptdis) *ptdis = dis;
  }
  else
  {
    if (typ(dn) != t_INT || signe(dn) <= 0)
      pari_err_TYPE("initgaloisborne [incorrect denominator]", dn);
    den = dn;
  }
  if (ptprep) *ptprep = prep;
  *ptL = L; return den;
}
GEN initgaloisborne ( GEN T , GEN dn , long prec , GEN * ptL , GEN * ptprep , GEN * ptdis ) { GEN L , prep , den , nf , r ; pari_timer ti ; if ( DEBUGLEVEL >= 4 ) timer_start ( & ti ) ; T = get_nfpol ( T , & nf ) ; r = nf ? nf_get_roots ( nf ) : NULL ; if ( nf && precision ( gel ( r , 1 ) ) >= prec ) L = embed_roots ( r , nf_get_r1 ( nf ) ) ; else L = QX_complex_roots ( T , prec ) ; if ( DEBUGLEVEL >= 4 ) timer_printf ( & ti , " " ) ; prep = vandermondeinverseprep ( L ) ; if ( ! dn ) { GEN dis , res = RgV_prod ( gabs ( prep , prec ) ) ; dis = ZX_disc_all ( T , 1 + expi ( ceil_safe ( res ) ) ) ; den = indexpartial ( T , dis ) ; if ( ptdis ) * ptdis = dis ; } else { if ( typ ( dn ) != t_INT || signe ( dn ) <= 0 ) pari_err_TYPE ( " " , dn ) ; den = dn ; } if ( ptprep ) * ptprep = prep ; * ptL = L ; return den ; }
Compute bound for the coefficients of automorphisms.
Compute bound for the coefficients of automorphisms .
/*Add +1 to cater for accuracy error in res */