bridge/class-master/depend/pari/src/basemath/mftrace.c
/* If f is NULL, give all the galoistypes, otherwise just for f */
If f is NULL, give all the galoistypes, otherwise just for f
If f is NULL give all the galoistypes otherwise just for f
GEN
mfgaloistype(GEN NK, GEN f)
{
  pari_sp av = avma;
  GEN CHI, T, F, DIH, mf = checkMF_i(NK);
  long N, k, lL, i, lim, SB;
  if (f && !checkmf_i(f)) pari_err_TYPE("mfgaloistype", f);
  if (mf)
  {
    N = MF_get_N(mf);
    k = MF_get_k(mf);
    CHI = MF_get_CHI(mf);
  }
  else
  {
    checkNK(NK, &N, &k, &CHI, 0);
    mf = f? NULL: mfinit_i(NK, mf_NEW);
  }
  if (k != 1) pari_err_DOMAIN("mfgaloistype", "k", "!=", gen_1, stoi(k));
  SB = mf? mfsturm_mf(mf): mfsturmNk(N,1);
  DIH = mfdihedralnew(N,CHI);
  lim = lg(DIH) == 1? 200: SB;
  DIH = mkvec2(DIH, mfvectomat(DIH,SB,1));
  if (f) return gerepileuptoint(av, mfgaloistype0(N,CHI, f, DIH, lim));
  F = mfeigenbasis(mf); lL = lg(F);
  T = cgetg(lL, t_VEC);
  for (i=1; i < lL; i++) gel(T,i) = mfgaloistype0(N, CHI, gel(F,i), DIH, lim);
  return gerepileupto(av, T);
}
GEN mfgaloistype ( GEN NK , GEN f ) { pari_sp av = avma ; GEN CHI , T , F , DIH , mf = checkMF_i ( NK ) ; long N , k , lL , i , lim , SB ; if ( f && ! checkmf_i ( f ) ) pari_err_TYPE ( " " , f ) ; if ( mf ) { N = MF_get_N ( mf ) ; k = MF_get_k ( mf ) ; CHI = MF_get_CHI ( mf ) ; } else { checkNK ( NK , & N , & k , & CHI , 0 ) ; mf = f ? NULL : mfinit_i ( NK , mf_NEW ) ; } if ( k != 1 ) pari_err_DOMAIN ( " " , " " , " " , gen_1 , stoi ( k ) ) ; SB = mf ? mfsturm_mf ( mf ) : mfsturmNk ( N , 1 ) ; DIH = mfdihedralnew ( N , CHI ) ; lim = lg ( DIH ) == 1 ? 200 : SB ; DIH = mkvec2 ( DIH , mfvectomat ( DIH , SB , 1 ) ) ; if ( f ) return gerepileuptoint ( av , mfgaloistype0 ( N , CHI , f , DIH , lim ) ) ; F = mfeigenbasis ( mf ) ; lL = lg ( F ) ; T = cgetg ( lL , t_VEC ) ; for ( i = 1 ; i < lL ; i ++ ) gel ( T , i ) = mfgaloistype0 ( N , CHI , gel ( F , i ) , DIH , lim ) ; return gerepileupto ( av , T ) ; }
If f is NULL, give all the galoistypes, otherwise just for f
If f is NULL give all the galoistypes otherwise just for f