/* compute a matrix which permits the extension of an existing permutation representation for a group by a group of order p^rank; the matrix rows are indexed from 0 .. p^rank - 1; the matrix columns are indexed by the defining generators and their inverses in the sequence 1, 1^-1, 2, 2^-1, etc.
M[i][j] = k, where a = (a_1,.....a_rank) is the vector of coefficients of the p-adic expansion of i, b is the vector of coefficients of the p-adic expansion of k, and within the
p-group b = a * im(j) */
int *expand; /* array to store p-adic expansion */ registerint rank = y[pcp->clend + pcp->cc]; registerint i, j, gen, sum; int bound; int **M; int index; int *powers; /* store powers of p to avoid recomputation */ registerint p = pcp->p; int cp = pcp->lused; int ptr;
bound = int_power(p, rank);
/* set up room to store p-adic expansion and powers of p */
expand = allocate_vector(rank, 0, TRUE);
powers = allocate_vector(rank, 0, FALSE);
for (i = 0; i < rank; ++i)
powers[i] = int_power(p, i);
/* set up matrix to store results */
M = allocate_matrix(bound, 2 * pcp->ndgen, 0, FALSE);
for (i = 0; i < bound; ++i) {
/* find the p-adic expansion of i */
compute_padic(powers, i, rank - 1, p, expand);
/* now process each defining generator and its inverse in turn */
for (gen = -pcp->ndgen; gen <= pcp->ndgen; ++gen) {
if (gen == 0) continue;
/* now copy p-adic expansion to y */ for (j = 0; j < rank; ++j)
y[cp + j + 1] = expand[j];
#ifdefined(DEBUG)
printf("processing generator %d \n", gen);
printf("Stored p-adic expansion for %d in y is ", i); for (j = 1; j <= pcp->lastg; ++j) {
printf("%d ", y[cp + j]);
}
printf("\n"); #endif
/* look up image of gen which is stored as a generator-exponent
string in y; post-multiply the p-adic expansion by this image */
/* compute p-adic expansion of x, where x < p^(k + 1) */
void compute_padic(int *powers, int x, int k, int p, int *expand)
{ registerint alpha; registerint val;
while (x > 0 && k >= 0) {
val = powers[k]; if (val <= x) { /* find largest multiple of p^k < x */
alpha = p - 1; while (alpha * val > x)
--alpha;
expand[k] = alpha;
x -= alpha * val;
}
--k;
}
}
¤ Dauer der Verarbeitung: 0.39 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.