bridge/class-master/depend/pari/src/basemath/nffactor.c
/* Choose prime ideal unramified with "large" inertia degree */
Choose prime ideal unramified with "large" inertia degree
Choose prime ideal unramified with " large " inertia degree
static void
nf_pick_prime_for_units(GEN nf, nflift_t *L)
{
  GEN nfpol = nf_get_pol(nf), bad = mulii(nf_get_disc(nf), nf_get_index(nf));
  GEN ap = NULL, r = NULL;
  long nfdeg = degpol(nfpol), maxf = get_maxf(nfdeg);
  ulong pp;
  forprime_t S;
  (void)u_forprime_init(&S, 2, ULONG_MAX);
  while ( (pp = u_forprime_next(&S)) )
  {
    if (! umodiu(bad,pp)) continue;
    r = get_good_factor(nfpol, pp, maxf);
    if (r) break;
  }
  if (!r) pari_err_OVERFLOW("nf_pick_prime [ran out of primes]");
  r = gel(r,lg(r)-1); 
  ap = utoipos(pp);
  L->p = ap;
  L->Tp = Flx_to_ZX(r);
  L->tozk = nf_get_invzk(nf);
  L->topow = nf_get_zkprimpart(nf);
  L->topowden = nf_get_zkden(nf);
}
static void nf_pick_prime_for_units ( GEN nf , nflift_t * L ) { GEN nfpol = nf_get_pol ( nf ) , bad = mulii ( nf_get_disc ( nf ) , nf_get_index ( nf ) ) ; GEN ap = NULL , r = NULL ; long nfdeg = degpol ( nfpol ) , maxf = get_maxf ( nfdeg ) ; ulong pp ; forprime_t S ; ( void ) u_forprime_init ( & S , 2 , ULONG_MAX ) ; while ( ( pp = u_forprime_next ( & S ) ) ) { if ( ! umodiu ( bad , pp ) ) continue ; r = get_good_factor ( nfpol , pp , maxf ) ; if ( r ) break ; } if ( ! r ) pari_err_OVERFLOW ( " " ) ; r = gel ( r , lg ( r ) - 1 ) ; ap = utoipos ( pp ) ; L -> p = ap ; L -> Tp = Flx_to_ZX ( r ) ; L -> tozk = nf_get_invzk ( nf ) ; L -> topow = nf_get_zkprimpart ( nf ) ; L -> topowden = nf_get_zkden ( nf ) ; }
Choose prime ideal unramified with "large" inertia degree
Choose prime ideal unramified with " large " inertia degree
/* largest inertia degree */