bridge/class-master/depend/pari/src/basemath/base5.c
/* lift ideal x to the relative extension, returns a Z-basis */
lift ideal x to the relative extension, returns a Z-basis
lift ideal x to the relative extension returns a Z - basis
GEN
rnfidealup(GEN rnf,GEN x)
{
  pari_sp av = avma;
  long i, n;
  GEN nf, bas, bas2, I, x2;
  checkrnf(rnf); nf = rnf_get_nf(rnf);
  n = rnf_get_degree(rnf);
  bas = rnf_get_zk(rnf); bas2 = gel(bas,2);
  (void)idealtyp(&x, &I); 
  x2 = idealtwoelt(nf,x);
  I = cgetg(n+1,t_VEC);
  for (i=1; i<=n; i++)
  {
    GEN c = gel(bas2,i), d;
    if (typ(c) == t_MAT)
    {
      c = Q_remove_denom(c,&d);
      c = idealHNF_mul(nf,c,x2);
      if (d) c = gdiv(c,d);
    }
    else
      c = idealmul(nf,c,x);
    gel(I,i) = c;
  }
  return gerepilecopy(av, modulereltoabs(rnf, mkvec2(gel(bas,1), I)));
}
GEN rnfidealup ( GEN rnf , GEN x ) { pari_sp av = avma ; long i , n ; GEN nf , bas , bas2 , I , x2 ; checkrnf ( rnf ) ; nf = rnf_get_nf ( rnf ) ; n = rnf_get_degree ( rnf ) ; bas = rnf_get_zk ( rnf ) ; bas2 = gel ( bas , 2 ) ; ( void ) idealtyp ( & x , & I ) ; x2 = idealtwoelt ( nf , x ) ; I = cgetg ( n + 1 , t_VEC ) ; for ( i = 1 ; i <= n ; i ++ ) { GEN c = gel ( bas2 , i ) , d ; if ( typ ( c ) == t_MAT ) { c = Q_remove_denom ( c , & d ) ; c = idealHNF_mul ( nf , c , x2 ) ; if ( d ) c = gdiv ( c , d ) ; } else c = idealmul ( nf , c , x ) ; gel ( I , i ) = c ; } return gerepilecopy ( av , modulereltoabs ( rnf , mkvec2 ( gel ( bas , 1 ) , I ) ) ) ; }
lift ideal x to the relative extension, returns a Z-basis
lift ideal x to the relative extension returns a Z - basis
/* I is junk */