bridge/class-master/depend/pari/src/basemath/base3.c
/* L from ideallist, add archimedean part */
L from ideallist, add archimedean part
L from ideallist add archimedean part
GEN
ideallistarch(GEN bnf, GEN L, GEN arch)
{
  pari_sp av;
  long i, j, l = lg(L), lz;
  GEN v, z, V;
  ideal_data ID;
  GEN (*join_z)(ideal_data*, GEN);
  if (typ(L) != t_VEC) pari_err_TYPE("ideallistarch",L);
  if (l == 1) return cgetg(1,t_VEC);
  z = gel(L,1);
  if (typ(z) != t_VEC) pari_err_TYPE("ideallistarch",z);
  z = gel(z,1); 
  ID.nf = checknf(bnf);
  ID.archp = vec01_to_indices(arch);
  if (lg(z) == 3) { 
    if (typ(z) != t_VEC) pari_err_TYPE("ideallistarch",z);
    ID.emb = zm_to_ZM( rowpermute(nfsign_units(bnf,NULL,1), ID.archp) );
    join_z = &join_archunit;
  } else
    join_z = &join_arch;
  av = avma; V = cgetg(l, t_VEC);
  for (i = 1; i < l; i++)
  {
    z = gel(L,i); lz = lg(z);
    gel(V,i) = v = cgetg(lz,t_VEC);
    for (j=1; j<lz; j++) gel(v,j) = join_z(&ID, gel(z,j));
  }
  return gerepilecopy(av,V);
}
GEN ideallistarch ( GEN bnf , GEN L , GEN arch ) { pari_sp av ; long i , j , l = lg ( L ) , lz ; GEN v , z , V ; ideal_data ID ; GEN ( * join_z ) ( ideal_data * , GEN ) ; if ( typ ( L ) != t_VEC ) pari_err_TYPE ( " " , L ) ; if ( l == 1 ) return cgetg ( 1 , t_VEC ) ; z = gel ( L , 1 ) ; if ( typ ( z ) != t_VEC ) pari_err_TYPE ( " " , z ) ; z = gel ( z , 1 ) ; ID . nf = checknf ( bnf ) ; ID . archp = vec01_to_indices ( arch ) ; if ( lg ( z ) == 3 ) { if ( typ ( z ) != t_VEC ) pari_err_TYPE ( " " , z ) ; ID . emb = zm_to_ZM ( rowpermute ( nfsign_units ( bnf , NULL , 1 ) , ID . archp ) ) ; join_z = & join_archunit ; } else join_z = & join_arch ; av = avma ; V = cgetg ( l , t_VEC ) ; for ( i = 1 ; i < l ; i ++ ) { z = gel ( L , i ) ; lz = lg ( z ) ; gel ( V , i ) = v = cgetg ( lz , t_VEC ) ; for ( j = 1 ; j < lz ; j ++ ) gel ( v , j ) = join_z ( & ID , gel ( z , j ) ) ; } return gerepilecopy ( av , V ) ; }
L from ideallist, add archimedean part
L from ideallist add archimedean part
/* either a bid or [bid,U] */ /* the latter: do units */