bridge/class-master/depend/pari/src/basemath/buch4.c
/* system of representatives for Zk/pr */
system of representatives for Zk/pr
system of representatives for Zk / pr
static GEN
repres(GEN nf, GEN pr)
{
  long f = pr_get_f(pr), N = nf_get_degree(nf), p = itos(pr_get_p(pr));
  long i, j, k, pi, pf = upowuu(p, f);
  GEN perm = pr_basis_perm(nf, pr), rep = cgetg(pf+1,t_VEC);
  gel(rep,1) = zerocol(N);
  for (pi=i=1; i<=f; i++,pi*=p)
  {
    long t = perm[i];
    for (j=1; j<p; j++)
      for (k=1; k<=pi; k++) gel(rep, j*pi+k) = ZC_add_coeff(gel(rep,k), t, j);
  }
  return rep;
}
static GEN repres ( GEN nf , GEN pr ) { long f = pr_get_f ( pr ) , N = nf_get_degree ( nf ) , p = itos ( pr_get_p ( pr ) ) ; long i , j , k , pi , pf = upowuu ( p , f ) ; GEN perm = pr_basis_perm ( nf , pr ) , rep = cgetg ( pf + 1 , t_VEC ) ; gel ( rep , 1 ) = zerocol ( N ) ; for ( pi = i = 1 ; i <= f ; i ++ , pi *= p ) { long t = perm [ i ] ; for ( j = 1 ; j < p ; j ++ ) for ( k = 1 ; k <= pi ; k ++ ) gel ( rep , j * pi + k ) = ZC_add_coeff ( gel ( rep , k ) , t , j ) ; } return rep ; }
system of representatives for Zk/pr
system of representatives for Zk / pr