bridge/class-master/depend/pari/src/basemath/base5.c
/* x a relative HNF => vector of 2 generators (relative polmods) */
x a relative HNF => vector of 2 generators (relative polmods)
x a relative HNF = > vector of 2 generators ( relative polmods )
GEN
rnfidealtwoelement(GEN rnf, GEN x)
{
  pari_sp av = avma;
  GEN y, cy, z, NF;
  y = rnfidealreltoabs_i(rnf,x);
  rnfcomplete(rnf);
  NF = obj_check(rnf,rnf_NFABS);
  y = matalgtobasis(NF, y); settyp(y, t_MAT);
  y = Q_primitive_part(y, &cy);
  y = ZM_hnf(y);
  if (lg(y) == 1) { avma = av; return mkvec2(gen_0, gen_0); }
  y = idealtwoelt(NF, y);
  if (cy) y = RgV_Rg_mul(y, cy);
  z = gel(y,2);
  if (typ(z) == t_COL) z = rnfeltabstorel(rnf, nf_to_scalar_or_alg(NF, z));
  return gerepilecopy(av, mkvec2(gel(y,1), z));
}
GEN rnfidealtwoelement ( GEN rnf , GEN x ) { pari_sp av = avma ; GEN y , cy , z , NF ; y = rnfidealreltoabs_i ( rnf , x ) ; rnfcomplete ( rnf ) ; NF = obj_check ( rnf , rnf_NFABS ) ; y = matalgtobasis ( NF , y ) ; settyp ( y , t_MAT ) ; y = Q_primitive_part ( y , & cy ) ; y = ZM_hnf ( y ) ; if ( lg ( y ) == 1 ) { avma = av ; return mkvec2 ( gen_0 , gen_0 ) ; } y = idealtwoelt ( NF , y ) ; if ( cy ) y = RgV_Rg_mul ( y , cy ) ; z = gel ( y , 2 ) ; if ( typ ( z ) == t_COL ) z = rnfeltabstorel ( rnf , nf_to_scalar_or_alg ( NF , z ) ) ; return gerepilecopy ( av , mkvec2 ( gel ( y , 1 ) , z ) ) ; }
x a relative HNF => vector of 2 generators (relative polmods)
x a relative HNF = > vector of 2 generators ( relative polmods )