Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

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

563501 views
1
/****************************************************************************
2
**
3
*A autgp_order.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 "global.h"
16
#include "standard.h"
17
18
#ifdef HAVE_GMP
19
20
/* update the order of the automorphism group */
21
22
void
23
update_autgp_order(int orbit_length, struct pga_vars *pga, struct pcp_vars *pcp)
24
{
25
register int *y = y_address;
26
27
register int d, nmr_cent;
28
MP_INT prime, nmr_centrals, orbit_size;
29
MP_INT t;
30
31
/* divide existing automorphism group order by size of orbit */
32
mpz_init_set_si(&orbit_size, orbit_length);
33
mpz_div(&(pga->aut_order), &(pga->aut_order), &orbit_size);
34
35
/* multiply existing order by order of new central automorphisms */
36
if (pga->final_stage) {
37
38
d = y[pcp->clend + 1];
39
/*
40
nmr_cent = y[pcp->clend + pcp->cc] - y[pcp->clend + pcp->cc - 1];
41
*/
42
nmr_cent = pga->nmr_centrals;
43
44
mpz_init_set_si(&prime, pcp->p);
45
mpz_init(&nmr_centrals);
46
47
/*
48
mpz_pow_ui (&nmr_centrals, &prime, nmr_cent * d);
49
*/
50
mpz_pow_ui(&nmr_centrals, &prime, nmr_cent);
51
52
mpz_init(&t);
53
mpz_mul(&t, &(pga->aut_order), &nmr_centrals);
54
mpz_set(&(pga->aut_order), &t);
55
/* mpz_mul (&(pga->aut_order), &(pga->aut_order), &nmr_centrals);
56
*/
57
mpz_clear(&t);
58
mpz_clear(&prime);
59
mpz_clear(&nmr_centrals);
60
}
61
mpz_clear(&orbit_size);
62
}
63
64
/* report the group and automorphism group order */
65
66
void report_autgp_order(struct pga_vars *pga, struct pcp_vars *pcp)
67
{
68
int p, n;
69
char *s;
70
71
if (StandardPresentation)
72
return;
73
74
p = pcp->p;
75
n = pcp->lastg;
76
77
if (pga->print_automorphism_order && (pga->capable || pga->terminal)) {
78
s = pga->upper_bound ? "at most " : "";
79
printf("Order of group is %d^%d;", p, n);
80
printf(" automorphism group order is %s", s);
81
mpz_out_str(stdout, 10, &(pga->aut_order));
82
printf("\n");
83
}
84
}
85
86
/* compute (an upper bound for) the order of the automorphism group */
87
88
void autgp_order(struct pga_vars *pga, struct pcp_vars *pcp)
89
{
90
register int *y = y_address;
91
92
MP_INT diff, prime, nmr_centrals, sub, large;
93
MP_INT t;
94
95
register int i, d, n, p;
96
char *s;
97
98
p = pcp->p;
99
d = y[pcp->clend + 1];
100
n = y[pcp->clend + pcp->cc - 1];
101
102
mpz_init_set_si(&(pga->aut_order), 1);
103
mpz_init_set_si(&prime, pcp->p);
104
105
/* large = p^d */
106
mpz_init(&large);
107
mpz_pow_ui(&large, &prime, d);
108
109
mpz_init_set_si(&sub, 1);
110
111
for (i = 0; i < d; ++i) {
112
mpz_init(&diff);
113
mpz_sub(&diff, &large, &sub);
114
mpz_mul(&(pga->aut_order), &(pga->aut_order), &diff);
115
mpz_mul(&sub, &sub, &prime);
116
mpz_clear(&diff);
117
}
118
119
mpz_init(&nmr_centrals);
120
mpz_pow_ui(&nmr_centrals, &prime, (n - d) * d);
121
/* mpz_mul (&(pga->aut_order), &(pga->aut_order), &nmr_centrals);
122
*/
123
mpz_init(&t);
124
mpz_mul(&t, &(pga->aut_order), &nmr_centrals);
125
mpz_set(&(pga->aut_order), &t);
126
mpz_clear(&t);
127
128
mpz_clear(&sub);
129
mpz_clear(&large);
130
mpz_clear(&prime);
131
mpz_clear(&nmr_centrals);
132
133
/* if d < n, we only have an upper bound for the order */
134
pga->upper_bound = (d < n);
135
136
if (StandardPresentation) {
137
s = pga->upper_bound ? "at most " : "";
138
printf("Starting group has order %d^%d;", p, n);
139
printf(" its automorphism group order is %s", s);
140
mpz_out_str(stdout, 10, &(pga->aut_order));
141
printf(" \n");
142
}
143
}
144
#endif
145
146