bridge/class-master/depend/pari/src/basemath/lfunutils.c
/********************************************************************/
/**  Artin L function, based on a GP script by Charlotte Euvrard   **/
/********************************************************************/
Artin L function, based on a GP script by Charlotte Euvrard
Artin L function based on a GP script by Charlotte Euvrard
static GEN
artin_charfromgens(GEN G, GEN M)
{
  GEN R, V, ord = gal_get_orders(G), grp = gal_get_group(G);
  long i, j, k, n = lg(ord)-1, m = lg(grp)-1;
  if (lg(M)-1 != n) pari_err_DIM("lfunartin");
  R = cgetg(m+1, t_VEC);
  gel(R, 1) = matid(lg(gel(M, 1))-1);
  for (i = 1, k = 1; i <= n; ++i)
  {
    long c = k*(ord[i] - 1);
    gel(R, ++k) = gel(M, i);
    for (j = 2; j <= c; ++j) gel(R, ++k) = gmul(gel(R,j), gel(M,i));
  }
  V = cgetg(m+1, t_VEC);
  for (i = 1; i <= m; i++) gel(V, gel(grp,i)[1]) = gtrace(gel(R,i));
  return V;
}
static GEN artin_charfromgens ( GEN G , GEN M ) { GEN R , V , ord = gal_get_orders ( G ) , grp = gal_get_group ( G ) ; long i , j , k , n = lg ( ord ) - 1 , m = lg ( grp ) - 1 ; if ( lg ( M ) - 1 != n ) pari_err_DIM ( " " ) ; R = cgetg ( m + 1 , t_VEC ) ; gel ( R , 1 ) = matid ( lg ( gel ( M , 1 ) ) - 1 ) ; for ( i = 1 , k = 1 ; i <= n ; ++ i ) { long c = k * ( ord [ i ] - 1 ) ; gel ( R , ++ k ) = gel ( M , i ) ; for ( j = 2 ; j <= c ; ++ j ) gel ( R , ++ k ) = gmul ( gel ( R , j ) , gel ( M , i ) ) ; } V = cgetg ( m + 1 , t_VEC ) ; for ( i = 1 ; i <= m ; i ++ ) gel ( V , gel ( grp , i ) [ 1 ] ) = gtrace ( gel ( R , i ) ) ; return V ; }
Artin L function, based on a GP script by Charlotte Euvrard
Artin L function based on a GP script by Charlotte Euvrard