giventhelabelofanorbitrepresentative,itsp-adic
expansion corresponds to the element */
void expand_padic(int x, int k, int p, int *expand)
{ register int alpha; register int val;
while (x > 0 && k >= 0) {
val = int_power(p, 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;
}
}
void padic(int p, int rank, struct pga_vars *pga)
{
int number;
int *expand;
int bound = rank;
int i, r;
expand = allocate_vector(rank + 1, 0, FALSE);
for (r = 1; r <= pga->nmr_orbits; ++r) {
number = pga->rep[r];
for (i = 0; i <= rank; ++i)
expand[i] = 0;
bound = rank; while (bound > 0 && int_power(p, bound) > number)
--bound;
++bound;
expand_padic(number, bound, p, expand);
printf("The element with label %5d is ", number);
print_array(expand, 0, rank);
}
}
void permute_elements(void)
{
int index;
int **position;
int rank;
int p;
int i;
int label;
int map;
int **A;
int **B;
int subgp = 0;
int **permutation; struct pga_vars pga;
int *length;
int alpha;
int m;
int q, x;
int *orbit;
char *schreier;
int *backptr;
int nmr_maps;
int Degree;
read_value(TRUE, "Input rank of vector space: ", &rank, 1);
read_value(TRUE, "Input prime: ", &p, 2);
read_value(TRUE, "Input number of automorphism matrices: ", &m, 0);
read_value(TRUE, "Input number of multiplication maps: ", &nmr_maps, 0);
Degree = int_power(p, rank);
position = allocate_matrix(1, rank + 1, 0, 0);
permutation = allocate_matrix(nmr_maps + m, Degree, 1, 0);
q = rank;
A = allocate_matrix(q, rank + 1, 0, 0);
/* first process automorphisms */
for (alpha = 1; alpha <= m; ++alpha) {
printf("Input the matrix for automorphism %d\n", alpha);
read_matrix(A, q, q);
for (x = 0; x <= rank; ++x)
position[0][x] = 0;
subgp = 0; do {
index = 0;
++position[0][0]; while (index < rank && position[0][index] == p) {
position[0][index] = 0;
++index;
++position[0][index];
}
#ifdef DEBUG
printf("\n");
for (i = 0; i < rank; ++i)
printf("%d ", position[0][i]); #endif
label = 0;
for (i = 0; i < rank; ++i)
label += (position[0][i] * int_power(p, i)); #ifdef DEBUG
printf("label is %d\n", label); #endif
/* now multiply mod p */
B = multiply_matrix(position, 1, q, A, q, p); #ifdef DEBUG
print_matrix(B, 1, q); #endif
label = 0;
for (i = 0; i < rank; ++i)
label += (B[0][i] * int_power(p, i)); #ifdef DEBUG
printf("label is %d\n", label);
if (subgp % 10000 == 0)
printf("Completed %d subgroups\n", subgp); #endif
if (label == 0)
label = Degree;
permutation[alpha][++subgp] = label;
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 und die Messung sind noch experimentell.