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

563604 views
1
#include"typedef.h"
2
/**************************************************************************\
3
@---------------------------------------------------------------------------
4
@---------------------------------------------------------------------------
5
@ FILE: hyp_stabilizer.c
6
@---------------------------------------------------------------------------
7
@---------------------------------------------------------------------------
8
@
9
\**************************************************************************/
10
11
12
/**************************************************************************\
13
@---------------------------------------------------------------------------
14
@ bravais_TYP *hyperbolic_stabilizer(x, S)
15
@ matrix_TYP *x, *S;
16
@
17
@ the functions 'hyperbolic_stabilizer' calculates generators
18
@ for a finite subgroup G of GL_n(Q) with
19
@ vg = v and gSg^{tr} = S for all g in G.
20
@ where v denotes the first row of x.
21
@ The group H of all integral matrices with this property is
22
@ a subgroup of H.
23
@---------------------------------------------------------------------------
24
@
25
\**************************************************************************/
26
bravais_TYP *hyperbolic_stabilizer(x, S)
27
matrix_TYP *x, *S;
28
{
29
matrix_TYP *xS, *xS0, **Sred, *T, *Ti, *W, *W1;
30
bravais_TYP *G1, *G;
31
int i,j,k, n;
32
33
extern matrix_TYP *mat_mul();
34
extern matrix_TYP *mat_inv();
35
extern bravais_TYP *pr_aut();
36
extern matrix_TYP *solve_mat();
37
extern matrix_TYP *init_mat();
38
extern matrix_TYP *scal_pr();
39
40
n = x->cols;
41
xS = mat_mul(x, S);
42
xS0 = solve_mat(xS);
43
if((Sred = (matrix_TYP **)malloc(1*sizeof(matrix_TYP *))) == NULL)
44
{
45
printf("malloc of 'Sred' in 'hyperbolic_stabilizer' failed\n");
46
exit(2);
47
}
48
Sred[0] = scal_pr(xS0, S, 1);
49
G1 = pr_aut(Sred, 1, NULL, 0, NULL);
50
if((G = (bravais_TYP *)malloc(sizeof(bravais_TYP))) == NULL)
51
{
52
printf("malloc of 'G' in 'hyperbolic_stabilizer' failed\n");
53
exit(2);
54
}
55
G->gen_no = G1->gen_no;
56
if((G->gen = (matrix_TYP **)malloc(G->gen_no *sizeof(matrix_TYP *))) == NULL)
57
{
58
printf("malloc of 'G->gen' in 'hyperbolic_stabilizer' failed\n");
59
exit(2);
60
}
61
G->zentr_no = G->form_no = G->normal_no = G->cen_no = 0;
62
for(i=0;i<100;i++)
63
G->divisors[i] = G1->divisors[i];
64
G->order = G1->order;
65
G->dim = n;
66
T = init_mat(n,n,"");
67
for(i=0;i<n-1;i++)
68
{
69
for(j=0;j<n;j++)
70
T->array.SZ[i][j] = xS0->array.SZ[i][j];
71
}
72
for(i=0;i<n;i++)
73
T->array.SZ[n-1][i] = x->array.SZ[0][i];
74
Ti = mat_inv(T);
75
W = init_mat(n,n,"");
76
W->array.SZ[n-1][n-1] = 1;
77
for(i=0;i<G->gen_no;i++)
78
{
79
for(j=0;j<n-1;j++)
80
for(k=0;k<n-1;k++)
81
W->array.SZ[j][k] = G1->gen[i]->array.SZ[j][k];
82
W1 = mat_mul(Ti, W);
83
G->gen[i] = mat_mul(W1, T);
84
free_mat(W1);
85
}
86
free_mat(W); free_mat(T); free_mat(Ti);
87
free_bravais(G1);
88
free_mat(xS); free_mat(xS0); free_mat(Sred[0]); free(Sred);
89
return(G);
90
}
91
92