bridge/class-master/depend/pari/src/modules/algebras.c
/* returns Lpr augmented with an extra, distinct prime */
/* TODO be less lazy and return a small prime */
returns Lpr augmented with an extra, distinct prime
TODO be less lazy and return a small prime
returns Lpr augmented with an extra distinct prime TODO be less lazy and return a small prime
static GEN
extraprime(GEN nf, GEN Lpr)
{
  GEN Lpr2, p = gen_2, pr;
  long i;
  Lpr2 = cgetg(lg(Lpr)+1,t_VEC);
  for (i=1; i<lg(Lpr); i++)
  {
    gel(Lpr2,i) = gel(Lpr,i);
    p = gmax_shallow(p, pr_get_p(gel(Lpr,i)));
  }
  p = nextprime(addis(p,1));
  pr = gel(idealprimedec_limit_f(nf, p, 0), 1);
  gel(Lpr2,lg(Lpr)) = pr;
  return Lpr2;
}
static GEN extraprime ( GEN nf , GEN Lpr ) { GEN Lpr2 , p = gen_2 , pr ; long i ; Lpr2 = cgetg ( lg ( Lpr ) + 1 , t_VEC ) ; for ( i = 1 ; i < lg ( Lpr ) ; i ++ ) { gel ( Lpr2 , i ) = gel ( Lpr , i ) ; p = gmax_shallow ( p , pr_get_p ( gel ( Lpr , i ) ) ) ; } p = nextprime ( addis ( p , 1 ) ) ; pr = gel ( idealprimedec_limit_f ( nf , p , 0 ) , 1 ) ; gel ( Lpr2 , lg ( Lpr ) ) = pr ; return Lpr2 ; }
returns Lpr augmented with an extra, distinct prime
TODO be less lazy and return a small prime
returns Lpr augmented with an extra distinct prime TODO be less lazy and return a small prime