1 /****************************************************************************
2 **
3 *A read_auts.c ANUPQ source Eamonn O'Brien
4 **
5 *Y Copyright 1995-2001, Lehrstuhl D fuer Mathematik, RWTH Aachen, Germany
6 *Y Copyright 1995-2001, School of Mathematical Sciences, ANU, Australia
7 **
8 */
9
10 #include "pq_defs.h"
11 #include "constants.h"
12 #include "pcp_vars.h"
13 #include "pq_functions.h"
14 #include "standard.h"
15
16 /* for each automorphism in turn, read its actions on each
17 of the pcp generators of the Frattini quotient */
18
read_auts(int option,int * nmr_of_auts,int * nmr_of_exponents,struct pcp_vars * pcp)19 int ***read_auts(int option,
20 int *nmr_of_auts,
21 int *nmr_of_exponents,
22 struct pcp_vars *pcp)
23 {
24 register int *y = y_address;
25
26 register int i, j, k;
27 int ***auts;
28 int nmr_of_generators;
29
30 read_value(TRUE, "Input the number of automorphisms: ", nmr_of_auts, 0);
31
32 if (*nmr_of_auts == 0)
33 return NULL;
34
35 /* allocate sufficient space to store the automorphisms --
36 the indices of the array have been adjusted to start at 1,
37 rather than 0, because it simplifies the automorphism handling */
38
39 if (option == PGA || option == STANDARDISE)
40 *nmr_of_exponents = y[pcp->clend + pcp->cc - 1];
41 else {
42 if (option == PQ && pcp->cc > 1)
43 read_value(TRUE,
44 "Input the number of exponents: ",
45 nmr_of_exponents,
46 y[pcp->clend + 1]);
47 else
48 *nmr_of_exponents = y[pcp->clend + 1];
49 }
50
51 nmr_of_generators = y[pcp->clend + 1];
52
53 if (option == PGA || option == STANDARDISE)
54 auts = allocate_array(*nmr_of_auts, pcp->lastg, pcp->lastg, TRUE);
55 else
56 auts = allocate_array(
57 *nmr_of_auts, nmr_of_generators, *nmr_of_exponents, TRUE);
58
59 for (i = 1; i <= *nmr_of_auts; ++i) {
60 printf("Now enter the data for automorphism %d\n", i);
61 for (j = 1; j <= nmr_of_generators; ++j) {
62 printf("Input %d exponents for image of pcp generator %d: ",
63 *nmr_of_exponents,
64 j);
65 for (k = 1; k < *nmr_of_exponents; ++k)
66 read_value(FALSE, "", &auts[i][j][k], 0);
67 read_value(TRUE, "", &auts[i][j][k], 0);
68 }
69 }
70
71 return auts;
72 }
73