bridge/class-master/depend/pari/src/basemath/mftrace.c
/* flag 0: period polynomial of F, >0 or <0 with corresponding parity */
flag 0: period polynomial of F, >0 or <0 with corresponding parity
flag 0 : period polynomial of F > 0 or <0 with corresponding parity
GEN
mfperiodpol(GEN mf0, GEN F, long flag, long bit)
{
  pari_sp av = avma;
  GEN pol, mf = checkMF_i(mf0);
  if (!mf) pari_err_TYPE("mfperiodpol",mf0);
  if (checkfs_i(F))
  {
    GEN mfpols = fs_get_pols(F);
    if (!mfs_checkmf(F, mf)) pari_err_TYPE("mfperiodpol [different mf]",F);
    pol = gel(mfpols, lg(mfpols)-1); 
  }
  else
  {
    GEN gk = MF_get_gk(mf);
    if (typ(gk) != t_INT) pari_err_TYPE("mfperiodpol [half-integral k]", mf);
    if (equali1(gk)) pari_err_TYPE("mfperiodpol [k = 1]", mf);
    F = mfsymbol_i(mf, F, NULL, bit);
    pol = fs_get_pols(F);
  }
  if (flag) pol = RgX_by_parity(pol, flag < 0);
  return gerepilecopy(av, RgX_embedall(pol, 0, fs_get_vE(F)));
}
GEN mfperiodpol ( GEN mf0 , GEN F , long flag , long bit ) { pari_sp av = avma ; GEN pol , mf = checkMF_i ( mf0 ) ; if ( ! mf ) pari_err_TYPE ( " " , mf0 ) ; if ( checkfs_i ( F ) ) { GEN mfpols = fs_get_pols ( F ) ; if ( ! mfs_checkmf ( F , mf ) ) pari_err_TYPE ( " " , F ) ; pol = gel ( mfpols , lg ( mfpols ) - 1 ) ; } else { GEN gk = MF_get_gk ( mf ) ; if ( typ ( gk ) != t_INT ) pari_err_TYPE ( " " , mf ) ; if ( equali1 ( gk ) ) pari_err_TYPE ( " " , mf ) ; F = mfsymbol_i ( mf , F , NULL , bit ) ; pol = fs_get_pols ( F ) ; } if ( flag ) pol = RgX_by_parity ( pol , flag < 0 ) ; return gerepilecopy ( av , RgX_embedall ( pol , 0 , fs_get_vE ( F ) ) ) ; }
flag 0: period polynomial of F, >0 or <0 with corresponding parity
flag 0 : period polynomial of F > 0 or <0 with corresponding parity
/* trivial coset is last */