bridge/class-master/depend/pari/src/modules/algebras.c
/* left multiplication table, as a vector space of dimension n over the splitting field (by right multiplication) */
left multiplication table, as a vector space of dimension n over the splitting field (by right multiplication)
left multiplication table as a vector space of dimension n over the splitting field ( by right multiplication )
static GEN
algalgmultable_cyc(GEN al, GEN x)
{
  pari_sp av = avma;
  long n = alg_get_degree(al), i, j;
  GEN res, rnf, auts, b, pol;
  rnf = alg_get_splittingfield(al);
  auts = alg_get_auts(al);
  b = alg_get_b(al);
  pol = rnf_get_pol(rnf);
  res = zeromatcopy(n,n);
  for (i=0; i<n; i++)
    gcoeff(res,i+1,1) = lift_shallow(rnfbasistoalg(rnf,gel(x,i+1)));
  for (i=0; i<n; i++) {
    for (j=1; j<=i; j++)
      gcoeff(res,i+1,j+1) = gmodulo(poleval(gcoeff(res,i-j+1,1),gel(auts,j)),pol);
    for (; j<n; j++)
      gcoeff(res,i+1,j+1) = gmodulo(gmul(b,poleval(gcoeff(res,n+i-j+1,1),gel(auts,j))), pol);
  }
  for (i=0; i<n; i++)
    gcoeff(res,i+1,1) = gmodulo(gcoeff(res,i+1,1),pol);
  return gerepilecopy(av, res);
}
static GEN algalgmultable_cyc ( GEN al , GEN x ) { pari_sp av = avma ; long n = alg_get_degree ( al ) , i , j ; GEN res , rnf , auts , b , pol ; rnf = alg_get_splittingfield ( al ) ; auts = alg_get_auts ( al ) ; b = alg_get_b ( al ) ; pol = rnf_get_pol ( rnf ) ; res = zeromatcopy ( n , n ) ; for ( i = 0 ; i < n ; i ++ ) gcoeff ( res , i + 1 , 1 ) = lift_shallow ( rnfbasistoalg ( rnf , gel ( x , i + 1 ) ) ) ; for ( i = 0 ; i < n ; i ++ ) { for ( j = 1 ; j <= i ; j ++ ) gcoeff ( res , i + 1 , j + 1 ) = gmodulo ( poleval ( gcoeff ( res , i - j + 1 , 1 ) , gel ( auts , j ) ) , pol ) ; for ( ; j < n ; j ++ ) gcoeff ( res , i + 1 , j + 1 ) = gmodulo ( gmul ( b , poleval ( gcoeff ( res , n + i - j + 1 , 1 ) , gel ( auts , j ) ) ) , pol ) ; } for ( i = 0 ; i < n ; i ++ ) gcoeff ( res , i + 1 , 1 ) = gmodulo ( gcoeff ( res , i + 1 , 1 ) , pol ) ; return gerepilecopy ( av , res ) ; }
left multiplication table, as a vector space of dimension n over the splitting field (by right multiplication)
left multiplication table as a vector space of dimension n over the splitting field ( by right multiplication )