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 defaults_pga.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
#define SINGLE_STAGE 5
16
17
/* set up algorithm and print defaults for p-group generation calculation */
18
19
void defaults_pga(int option,
20
int *k,
21
struct pga_vars *flag,
22
struct pga_vars *pga,
23
struct pcp_vars *pcp)
24
{
25
int default_algorithm;
26
int default_output;
27
int default_perm_info;
28
int default_group_info;
29
int default_orbit_info;
30
int default_automorphism_info;
31
32
set_defaults(flag);
33
34
if (option == SINGLE_STAGE)
35
read_step_size(pga, pcp);
36
flag->step_size = pga->step_size;
37
38
query_solubility(flag);
39
40
read_value(
41
TRUE, "Do you want default algorithm? ", &default_algorithm, INT_MIN);
42
if (!default_algorithm) {
43
read_subgroup_rank(k);
44
if (flag->soluble)
45
query_space_efficiency(flag);
46
query_terminal(flag);
47
query_exponent_law(flag);
48
query_metabelian_law(flag);
49
} else {
50
*k = 0;
51
}
52
53
read_value(TRUE, "Do you want default output? ", &default_output, INT_MIN);
54
if (default_output)
55
return;
56
57
read_value(TRUE,
58
"Do you want default permutation group output? ",
59
&default_perm_info,
60
INT_MIN);
61
if (!default_perm_info) {
62
query_degree_aut_information(flag);
63
query_perm_information(flag);
64
}
65
66
read_value(TRUE,
67
"Do you want default orbit information? ",
68
&default_orbit_info,
69
INT_MIN);
70
if (!default_orbit_info)
71
query_orbit_information(flag);
72
73
read_value(TRUE,
74
"Do you want default group information? ",
75
&default_group_info,
76
INT_MIN);
77
if (!default_group_info)
78
query_group_information(pcp->p, flag);
79
80
read_value(TRUE,
81
"Do you want default automorphism group information? ",
82
&default_automorphism_info,
83
INT_MIN);
84
if (!default_automorphism_info)
85
query_aut_group_information(flag);
86
87
read_value(TRUE,
88
"Do you want algorithm trace information? ",
89
&flag->trace,
90
INT_MIN);
91
}
92
93
/* set printing and algorithm defaults up in flag structure for storage */
94
95
void set_defaults(struct pga_vars *flag)
96
{
97
flag->print_extensions = FALSE;
98
flag->print_automorphism_matrix = FALSE;
99
100
flag->print_degree = FALSE;
101
flag->print_permutation = FALSE;
102
103
flag->print_subgroup = FALSE;
104
flag->print_reduced_cover = FALSE;
105
flag->print_group = FALSE;
106
flag->print_nuclear_rank = FALSE;
107
flag->print_multiplicator_rank = FALSE;
108
109
flag->print_orbit_summary = FALSE;
110
flag->print_orbits = FALSE;
111
flag->print_orbit_arrays = FALSE;
112
113
flag->print_commutator_matrix = FALSE;
114
flag->print_automorphisms = FALSE;
115
flag->print_automorphism_order = FALSE;
116
flag->print_stabiliser_array = FALSE;
117
118
flag->trace = FALSE;
119
120
flag->space_efficient = FALSE;
121
flag->soluble = TRUE;
122
flag->terminal = FALSE;
123
flag->metabelian = FALSE;
124
flag->exponent_law = 0;
125
}
126
127
/* copy printing and algorithm defaults from flag structure to pga */
128
129
void copy_flags(struct pga_vars *flag, struct pga_vars *pga)
130
{
131
pga->print_extensions = flag->print_extensions;
132
pga->print_automorphism_matrix = flag->print_automorphism_matrix;
133
134
pga->print_degree = flag->print_degree;
135
pga->print_permutation = flag->print_permutation;
136
137
pga->print_subgroup = flag->print_subgroup;
138
pga->print_reduced_cover = flag->print_reduced_cover;
139
pga->print_group = flag->print_group;
140
pga->print_nuclear_rank = flag->print_nuclear_rank;
141
pga->print_multiplicator_rank = flag->print_multiplicator_rank;
142
143
pga->print_orbits = flag->print_orbits;
144
pga->print_orbit_summary = flag->print_orbit_summary;
145
pga->print_orbit_arrays = flag->print_orbit_arrays;
146
147
pga->print_commutator_matrix = flag->print_commutator_matrix;
148
pga->print_automorphisms = flag->print_automorphisms;
149
pga->print_automorphism_order = flag->print_automorphism_order;
150
pga->print_stabiliser_array = flag->print_stabiliser_array;
151
152
pga->trace = flag->trace;
153
154
pga->space_efficient = flag->space_efficient;
155
pga->soluble = flag->soluble;
156
pga->terminal = flag->terminal;
157
pga->exponent_law = flag->exponent_law;
158
pga->metabelian = flag->metabelian;
159
160
pga->step_size = flag->step_size;
161
}
162
163
/* use space efficient option? */
164
165
void query_space_efficiency(struct pga_vars *pga)
166
{
167
read_value(
168
TRUE, "Space efficient computation? ", &pga->space_efficient, INT_MIN);
169
}
170
171
/* orbit information to be printed */
172
173
void query_orbit_information(struct pga_vars *pga)
174
{
175
read_value(TRUE,
176
"Summary of orbit information? ",
177
&pga->print_orbit_summary,
178
INT_MIN);
179
180
read_value(
181
TRUE, "Complete listing of orbits? ", &pga->print_orbits, INT_MIN);
182
183
pga->print_orbit_arrays = FALSE;
184
}
185
186
/* group information to be printed */
187
188
void query_group_information(int p, struct pga_vars *pga)
189
{
190
read_value(TRUE,
191
"Print standard matrix of allowable subgroup? ",
192
&pga->print_subgroup,
193
INT_MIN);
194
195
read_value(TRUE,
196
"Presentation of reduced p-covering groups? ",
197
&pga->print_reduced_cover,
198
INT_MIN);
199
200
read_value(TRUE,
201
"Presentation of immediate descendants? ",
202
&pga->print_group,
203
INT_MIN);
204
205
read_value(TRUE,
206
"Print nuclear rank of descendants? ",
207
&pga->print_nuclear_rank,
208
INT_MIN);
209
210
read_value(TRUE,
211
"Print p-multiplicator rank of descendants? ",
212
&pga->print_multiplicator_rank,
213
INT_MIN);
214
}
215
216
/* automorphism group information to be printed */
217
218
void query_aut_group_information(struct pga_vars *pga)
219
{
220
read_value(TRUE,
221
"Print commutator matrix? ",
222
&pga->print_commutator_matrix,
223
INT_MIN);
224
225
read_value(TRUE,
226
"Automorphism group description of descendants? ",
227
&pga->print_automorphisms,
228
INT_MIN);
229
230
#ifdef HAVE_GMP
231
read_value(TRUE,
232
"Automorphism group order of descendants? ",
233
&pga->print_automorphism_order,
234
INT_MIN);
235
#else
236
/* HACK: still ask the question, to prevent the GAP interface from
237
getting "confused" (it blindly fires input at us, without checking
238
what the prompt is). */
239
int fake;
240
read_value(TRUE,
241
"PLACEHOLDER QUESTION (GMP disabled), input any integer? ",
242
&fake,
243
INT_MIN);
244
#endif
245
246
pga->print_stabiliser_array = FALSE;
247
}
248
249
/* degree and extended automorphism information to be printed */
250
251
void query_degree_aut_information(struct pga_vars *pga)
252
{
253
read_value(TRUE,
254
"Print degree of permutation group? ",
255
&pga->print_degree,
256
INT_MIN);
257
258
read_value(
259
TRUE, "Print extended automorphisms? ", &pga->print_extensions, INT_MIN);
260
}
261
262
/* other permutation group information to be printed */
263
264
void query_perm_information(struct pga_vars *pga)
265
{
266
read_value(TRUE,
267
"Print automorphism matrices? ",
268
&pga->print_automorphism_matrix,
269
INT_MIN);
270
271
read_value(TRUE, "Print permutations? ", &pga->print_permutation, INT_MIN);
272
}
273
274
/* read step size */
275
276
void read_step_size(struct pga_vars *pga, struct pcp_vars *pcp)
277
{
278
Logical reading = TRUE;
279
280
while (reading) {
281
read_value(TRUE, "Input step size: ", &pga->step_size, 1);
282
reading = (pga->step_size <= 0);
283
if (isatty(0))
284
reading = (reading || (pga->step_size > pcp->newgen));
285
if (reading)
286
printf("Error: step sizes range from 1 to %d only\n", pcp->newgen);
287
/*
288
if (reading = (pga->step_size <= 0 || pga->step_size > pcp->newgen))
289
printf ("Error: step sizes range from 1 to %d only\n", pcp->newgen);
290
*/
291
}
292
}
293
294
/* read class bound */
295
296
void read_class_bound(int *class_bound, struct pcp_vars *pcp)
297
{
298
read_value(TRUE, "Input class bound on descendants: ", class_bound, pcp->cc);
299
}
300
301
/* read order bound */
302
303
void read_order_bound(int *order_bound, struct pcp_vars *pcp)
304
{
305
register int *y = y_address;
306
307
int least_order = y[pcp->clend + pcp->cc - 1] + 1;
308
read_value(
309
TRUE, "Input order bound on descendants: ", order_bound, least_order);
310
}
311
312
/* read rank of initial-segment subgroup */
313
314
void read_subgroup_rank(int *k)
315
{
316
read_value(TRUE, "Rank of the initial segment subgroup? ", k, 0);
317
*k = MAX(0, *k - 1);
318
}
319
320
/* supply a PAG-generating sequence for automorphism group? */
321
322
void query_solubility(struct pga_vars *pga)
323
{
324
read_value(TRUE,
325
"PAG-generating sequence for automorphism group? ",
326
&pga->soluble,
327
INT_MIN);
328
}
329
330
/* completely process all (capable and terminal) descendants? */
331
332
void query_terminal(struct pga_vars *pga)
333
{
334
read_value(TRUE,
335
"Completely process terminal descendants? ",
336
&pga->terminal,
337
INT_MIN);
338
}
339
340
/* set exponent law for all descendants to satisfy */
341
342
void query_exponent_law(struct pga_vars *pga)
343
{
344
read_value(
345
TRUE, "Input exponent law (0 if none): ", &pga->exponent_law, INT_MIN);
346
}
347
348
/* enforce metabelian law on all descendants */
349
350
void query_metabelian_law(struct pga_vars *pga)
351
{
352
read_value(TRUE, "Enforce metabelian law? ", &pga->metabelian, INT_MIN);
353
}
354
355