bridge/class-master/depend/pari/src/basemath/lfunutils.c
/* G is a bid of nftyp typ_BIDZ */
G is a bid of nftyp typ_BIDZ
G is a bid of nftyp typ_BIDZ
static GEN
lfunchiZ(GEN G, GEN chi)
{
  pari_sp av = avma;
  GEN sig = NULL;
  GEN N = bid_get_ideal(G), nchi, r;
  int real;
  if (typ(N) != t_INT) pari_err_TYPE("lfunchiZ", G);
  if (equali1(N)) return lfunzeta();
  if (typ(chi) != t_COL) chi = znconreylog(G,chi);
  N = znconreyconductor(G, chi, &chi);
  if (typ(N) != t_INT)
  {
    if (equali1(gel(N,1))) { avma = av; return lfunzeta(); }
    G = znstar0(N, 1);
    N = gel(N,1);
  }
  switch(itou_or_0(zncharorder(G, chi)))
  {
    case 1: avma = av; return lfunzeta();
    case 2: if (zncharisodd(G,chi)) N = negi(N);
            return gerepileupto(av, lfunchiquad(N));
  }
  sig = mkvec( zncharisodd(G, chi)? gen_1: gen_0 );
  nchi = znconreylog_normalize(G, chi);
  real = abscmpiu(gel(nchi,1), 2) <= 0;
  r = mkvecn(6, tag(mkvec2(G,nchi), t_LFUN_CHIZ),
                real? gen_0: gen_1, sig, gen_1, N, gen_0);
  return gerepilecopy(av, r);
}
static GEN lfunchiZ ( GEN G , GEN chi ) { pari_sp av = avma ; GEN sig = NULL ; GEN N = bid_get_ideal ( G ) , nchi , r ; int real ; if ( typ ( N ) != t_INT ) pari_err_TYPE ( " " , G ) ; if ( equali1 ( N ) ) return lfunzeta ( ) ; if ( typ ( chi ) != t_COL ) chi = znconreylog ( G , chi ) ; N = znconreyconductor ( G , chi , & chi ) ; if ( typ ( N ) != t_INT ) { if ( equali1 ( gel ( N , 1 ) ) ) { avma = av ; return lfunzeta ( ) ; } G = znstar0 ( N , 1 ) ; N = gel ( N , 1 ) ; } switch ( itou_or_0 ( zncharorder ( G , chi ) ) ) { case 1 : avma = av ; return lfunzeta ( ) ; case 2 : if ( zncharisodd ( G , chi ) ) N = negi ( N ) ; return gerepileupto ( av , lfunchiquad ( N ) ) ; } sig = mkvec ( zncharisodd ( G , chi ) ? gen_1 : gen_0 ) ; nchi = znconreylog_normalize ( G , chi ) ; real = abscmpiu ( gel ( nchi , 1 ) , 2 ) <= 0 ; r = mkvecn ( 6 , tag ( mkvec2 ( G , nchi ) , t_LFUN_CHIZ ) , real ? gen_0 : gen_1 , sig , gen_1 , N , gen_0 ) ; return gerepilecopy ( av , r ) ; }
G is a bid of nftyp typ_BIDZ
G is a bid of nftyp typ_BIDZ
/* chi now primitive on G */