bridge/class-master/depend/pari/src/basemath/mftrace.c
/* list of Hecke characters not induced by a Dirichlet character up to Galois
 * conjugation, whose conductor is bnr.cond; cycn = cyc_normalize(bnr.cyc)*/
list of Hecke characters not induced by a Dirichlet character up to Galois
conjugation, whose conductor is bnr.cond; cycn = cyc_normalize(bnr.cyc)
list of Hecke characters not induced by a Dirichlet character up to Galois conjugation whose conductor is bnr . cond ; cycn = cyc_normalize ( bnr . cyc )
static GEN
mklvchi(GEN bnr, GEN con, GEN cycn)
{
  GEN gb = NULL, cyc = bnr_get_cyc(bnr), cycsmall = ZV_to_zv(cyc);
  GEN vchi = cyc2elts(cycsmall);
  long ordmax = cycsmall[1], c, i, l;
  if (con)
  {
    GEN g = bnr_get_gen(bnr), nf = bnr_get_nf(bnr);
    long lg = lg(g);
    gb = cgetg(lg, t_VEC);
    for (i = 1; i < lg; i++)
      gel(gb,i) = ZV_to_zv(isprincipalray(bnr, galoisapply(nf, con, gel(g,i))));
  }
  l = lg(vchi);
  for (i = c = 1; i < l; i++)
  {
    GEN chi = gel(vchi,i);
    if (!con || Miyake(chi, gb, cycn)) gel(vchi, c++) = Flv_to_ZV(chi);
  }
  setlg(vchi, c); l = c;
  for (i = 1; i < l; i++)
  {
    GEN chi = gel(vchi,i);
    long n;
    if (!chi) continue;
    for (n = 2; n < ordmax; n++)
      if (ugcd(n, ordmax) == 1)
      {
        GEN tmp = vecmodii(gmulsg(n, chi), cyc);
        long j;
        for (j = i+1; j < l; j++)
          if (gel(vchi,j) && gequal(gel(vchi,j), tmp)) gel(vchi,j) = NULL;
      }
  }
  for (i = c = 1; i < l; i++)
  {
    GEN chi = gel(vchi,i);
    if (chi && bnrisconductor(bnr, chi)) gel(vchi, c++) = chi;
  }
  setlg(vchi, c); return vchi;
}
static GEN mklvchi ( GEN bnr , GEN con , GEN cycn ) { GEN gb = NULL , cyc = bnr_get_cyc ( bnr ) , cycsmall = ZV_to_zv ( cyc ) ; GEN vchi = cyc2elts ( cycsmall ) ; long ordmax = cycsmall [ 1 ] , c , i , l ; if ( con ) { GEN g = bnr_get_gen ( bnr ) , nf = bnr_get_nf ( bnr ) ; long lg = lg ( g ) ; gb = cgetg ( lg , t_VEC ) ; for ( i = 1 ; i < lg ; i ++ ) gel ( gb , i ) = ZV_to_zv ( isprincipalray ( bnr , galoisapply ( nf , con , gel ( g , i ) ) ) ) ; } l = lg ( vchi ) ; for ( i = c = 1 ; i < l ; i ++ ) { GEN chi = gel ( vchi , i ) ; if ( ! con || Miyake ( chi , gb , cycn ) ) gel ( vchi , c ++ ) = Flv_to_ZV ( chi ) ; } setlg ( vchi , c ) ; l = c ; for ( i = 1 ; i < l ; i ++ ) { GEN chi = gel ( vchi , i ) ; long n ; if ( ! chi ) continue ; for ( n = 2 ; n < ordmax ; n ++ ) if ( ugcd ( n , ordmax ) == 1 ) { GEN tmp = vecmodii ( gmulsg ( n , chi ) , cyc ) ; long j ; for ( j = i + 1 ; j < l ; j ++ ) if ( gel ( vchi , j ) && gequal ( gel ( vchi , j ) , tmp ) ) gel ( vchi , j ) = NULL ; } } for ( i = c = 1 ; i < l ; i ++ ) { GEN chi = gel ( vchi , i ) ; if ( chi && bnrisconductor ( bnr , chi ) ) gel ( vchi , c ++ ) = chi ; } setlg ( vchi , c ) ; return vchi ; }
list of Hecke characters not induced by a Dirichlet character up to Galois
 conjugation, whose conductor is bnr.cond; cycn = cyc_normalize(bnr.cyc)
list of Hecke characters not induced by a Dirichlet character up to Galois conjugation whose conductor is bnr . cond ; cycn = cyc_normalize ( bnr . cyc )