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

563665 views
1
/**************************************************************************\
2
@---------------------------------------------------------------------------
3
@---------------------------------------------------------------------------
4
@ FILE: pr_aut.c
5
@---------------------------------------------------------------------------
6
@---------------------------------------------------------------------------
7
@
8
\**************************************************************************/
9
10
#include "typedef.h"
11
#include "matrix.h"
12
#include "reduction.h"
13
#include "symm.h"
14
#include "autgrp.h"
15
#include "types.h"
16
17
static int normal_option;
18
static int perp_no;
19
static int ***perp;
20
static int perpdim;
21
static int ***perpbase;
22
static int ***perpprod;
23
static int *perpvec;
24
25
26
/*************************************************************************\
27
| The functions 'pr_aut' calculates generators and the order of the group
28
| G := {g in GL_n(Z) | g * Fo[i] * g^{tr} = Fo[i], 1<= i<= Foanz}
29
| returned via a pointer to 'bravais_TYP'.
30
| This function applues a pair reduction to Fo[0] before calculating
31
| the group
32
|
33
| The arguments of pr_aut are:
34
| matrix_TYP **Fo: a set of n times n matrices,
35
| the first must be positiv definite
36
| int Foanz: the number of the matrices given in 'Fo'.
37
| matrix_TYP **Erz: if already element of G are known,
38
| they can be used for calculating generators
39
| for the whole group.
40
| The matrices of known elements can be given
41
| to the function by the pointer 'Erz'.
42
| int Erzanz: The number of matrices given in 'Erz"
43
| int *options: see below.
44
|
45
| options is a pointer to integer (of length 6)
46
| The possible options are encoded in the following way:
47
| options[0]: The depth, up to wich scalar product combinations
48
| shall be calculated. The value should be small.
49
| options[0] > 0 should be used only, if the automorphismn
50
| group is expected to be small (with respect to the number
51
| of shortest vectors).
52
| options[1]: The n-point stabiliser with respect to different basis
53
| will be calculated.
54
| options[2]: If options[2] = 1, additional output is written to the
55
| file AUTO.tmp
56
| options[3]: If options[3] = 1, Bacher polynomials are used.
57
| If options[3] = 2, Bacher polynomial are used up to a deepth
58
| specified in options[4].
59
| If options[3] = 3, Bacher polynomials are used, using
60
| combinations of vectors having the scalar
61
| product specified in options[5]
62
| options[3] = 4 is the combination of options[3] = 2 and
63
| options[3] = 3.
64
| options[4]: A natural number number or zero (if options[3] = 2 or 4)
65
| options[5]: An integral number (if options[3] = 3 or 4)
66
|
67
| It is possible to use NULL for options,
68
| in this case option is assumed to be [0,0,0,0,0,0]
69
\*************************************************************************/
70
71
72
bravais_TYP *pr_aut(Fo, Foanz, Erz, Erzanz, options)
73
matrix_TYP **Fo, **Erz;
74
int Foanz, Erzanz, *options;
75
{
76
matrix_TYP **F, **E, *SV, *T, *Titr, *Ttr, *w;
77
bravais_TYP *G, *G1;
78
int n, anz, i;
79
80
if((F = (matrix_TYP **)malloc(Foanz *sizeof(matrix_TYP *))) == NULL)
81
{
82
printf("malloc of F in 'pr_aut' failed\n");
83
exit(2);
84
}
85
E = NULL;
86
if(Erzanz != 0)
87
if((E = (matrix_TYP **)malloc(Foanz *sizeof(matrix_TYP *))) == NULL)
88
{
89
printf("malloc of E in 'pr_aut' failed\n");
90
exit(2);
91
}
92
T = init_mat(Fo[0]->rows, Fo[0]->cols, "");
93
n = Fo[0]->cols;
94
for(i=0;i<n;i++)
95
T->array.SZ[i][i] = 1;
96
F[0] = pair_red(Fo[0], T);
97
Ttr = tr_pose(T);
98
Titr = mat_inv(Ttr);
99
for(i=1;i<Foanz;i++)
100
F[i] = scal_pr(T, Fo[i], 1);
101
SV = short_vectors(F[0], F[0]->array.SZ[n-1][n-1], 0, 0, 0, &anz);
102
for(i=0;i<Erzanz;i++)
103
{
104
w = mat_mul(Titr, Erz[i]);
105
E[i] = mat_mul(w, Ttr);
106
free_mat(w);
107
}
108
G1 = autgrp(F, Foanz, SV, E, Erzanz, options);
109
if ((G = (bravais_TYP *)malloc(sizeof(bravais_TYP))) == 0)
110
{
111
printf("malloc of 'G' in 'pr_aut' failed\n");
112
exit(2);
113
}
114
G->gen_no = G1->gen_no;
115
G->form_no = G->normal_no = G->cen_no = G->zentr_no = 0;
116
for(i=0;i<100;i++)
117
G->divisors[i] = G1->divisors[i];
118
G->order = G1->order;
119
G->dim = G1->gen[0]->cols;
120
if((G->gen = (matrix_TYP **)malloc(G->gen_no *sizeof(matrix_TYP *))) == NULL)
121
{
122
printf("mallocof 'G->gen' in 'pr_aut' failed\n");
123
exit(2);
124
}
125
for(i=0;i<G->gen_no;i++)
126
{
127
w = mat_mul(Ttr, G1->gen[i]);
128
G->gen[i] = mat_mul(w, Titr);
129
free_mat(w);
130
}
131
free_mat(T);
132
free_mat(Ttr);
133
free_mat(Titr); free_mat(SV);
134
for(i=0;i<Erzanz;i++)
135
free_mat(E[i]);
136
if(Erzanz != 0)
137
free(E);
138
for(i=0;i<Foanz;i++)
139
free_mat(F[i]);
140
free(F);
141
free_bravais(G1);
142
return(G);
143
}
144
145
146
147
/*********************************************
148
bravais_TYP *perfect_normal_autgrp(Fo, SV, Erz, Erzanz, options, P, Panz, Pbase, Pdim)
149
matrix_TYP *Fo, **Erz, *SV, **P, **Pbase;
150
int Erzanz, *options, Panz, Pdim;
151
*********************************************/
152
153