CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

Views: 418346
1
/****************************************************************************
2
**
3
*A find_allowable_subgroup.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 "pcp_vars.h"
12
#include "pga_vars.h"
13
#include "constants.h"
14
#include "pq_functions.h"
15
#include "standard.h"
16
17
#if defined(STANDARD_PCP)
18
19
/* given a presentation for the p-covering group of a
20
class c p-quotient; find the allowable subgroup which
21
determines the presentation for the class c + 1 quotient;
22
set up its definition set both as a bit_string and as a subset */
23
24
int **find_allowable_subgroup(int option,
25
FILE *cover_tmp_file,
26
FILE *group_tmp_file,
27
int *bit_string,
28
int **subset,
29
struct pga_vars *pga,
30
struct pcp_vars *pcp)
31
{
32
register int *y = y_address;
33
34
register int generator, exp, r, i;
35
register int structure, lastg;
36
register int start = pcp->ccbeg;
37
register int q = pga->q;
38
register int end = start + q - 1;
39
register int pointer;
40
register int length;
41
register int u, v;
42
int **definition;
43
int *relation;
44
int **subgroup;
45
int index, x;
46
int nmr_defs;
47
#include "access.h"
48
49
/* restore the presentation for the p-covering group */
50
restore_pcp(cover_tmp_file, pcp);
51
RESET(cover_tmp_file);
52
53
definition = allocate_matrix(q, 2, 0, FALSE);
54
55
structure = pcp->structure;
56
57
/* store the definitions of the generators of the relevant
58
initial segment subgroup of the p-multiplicator */
59
for (generator = start; generator <= end; ++generator) {
60
pointer = y[structure + generator];
61
u = PART2(pointer);
62
v = PART3(pointer);
63
definition[generator - start][0] = u;
64
definition[generator - start][1] = v;
65
}
66
67
#if defined(DEBUG)
68
printf("The definition matrix is\n");
69
print_matrix(definition, q, 2);
70
#endif
71
72
/* now restore the presentation for the class c + 1 quotient */
73
restore_pcp(group_tmp_file, pcp);
74
RESET(group_tmp_file);
75
76
#if defined(DEBUG)
77
pcp->diagn = TRUE;
78
print_presentation(TRUE, pcp);
79
pcp->diagn = FALSE;
80
#endif
81
82
structure = pcp->structure;
83
lastg = pcp->lastg;
84
85
subgroup = allocate_matrix(pga->s, q, 0, TRUE);
86
relation = allocate_vector(q, 0, TRUE);
87
88
*bit_string = 0;
89
*subset = allocate_vector(lastg - start + 1, 0, FALSE);
90
91
/* check the values of the definitions in this quotient
92
and set up its definition set */
93
index = 0;
94
for (generator = start; generator <= lastg; ++generator) {
95
pointer = y[structure + generator];
96
u = PART2(pointer);
97
v = PART3(pointer);
98
if ((x = find_index(u, v, definition, q)) != -1) {
99
*bit_string |= 1 << x;
100
(*subset)[index] = x;
101
subgroup[index++][x] = 1;
102
relation[x] = TRUE;
103
} else {
104
(*subset)[index++] = -1;
105
}
106
}
107
108
#if defined(DEBUG)
109
printf("Bit string and matrix are %d and ", *bit_string);
110
print_array(*subset, 0, lastg - start);
111
#endif
112
113
if (option == RELATIVE) {
114
nmr_defs = 0;
115
for (i = 0; i < lastg - start + 1; ++i)
116
if ((*subset)[i] >= 0)
117
++nmr_defs;
118
pga->s = nmr_defs;
119
120
/* memory leakage September 1996 */
121
free_matrix(definition, q, 0);
122
free_vector(relation, 0);
123
free_matrix(subgroup, pga->s, 0);
124
free_vector(*subset, 0);
125
*subset = (int *)0;
126
127
return (int **)0;
128
}
129
130
/* look up necessary relations in the class c + 1 quotient
131
and store the appropriate exponents in subgroup matrix */
132
for (r = 0; r < q; ++r) {
133
if (relation[r] == TRUE)
134
continue;
135
136
u = definition[r][0];
137
v = definition[r][1];
138
139
/* look up u^p or [u, v] */
140
pointer = (v == 0) ? y[pcp->ppower + u] : y[y[pcp->ppcomm + u] + v];
141
142
/* set up the exponents of these relations in the subgroup matrix */
143
if (pointer > 0)
144
subgroup[pointer - start][r] = 1;
145
else if (pointer < 0) {
146
pointer = -pointer + 1;
147
length = y[pointer];
148
for (i = 1; i <= length; i++) {
149
exp = FIELD1(y[pointer + i]);
150
generator = FIELD2(y[pointer + i]);
151
if (generator >= start)
152
subgroup[generator - start][r] = exp;
153
}
154
}
155
}
156
157
#if defined(DEBUG)
158
printf("The subgroup matrix is\n");
159
print_matrix(subgroup, pga->s, q);
160
#endif
161
162
free_matrix(definition, q, 0);
163
free_vector(relation, 0);
164
165
return subgroup;
166
}
167
168
/* which generator of the p-covering group did u and v define? */
169
170
int find_index(int u, int v, int **definition, int q)
171
{
172
register int i;
173
174
for (i = 0; i < q; ++i)
175
if (u == definition[i][0] && v == definition[i][1])
176
return i;
177
178
return -1;
179
}
180
#endif
181
182