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

563603 views
1
#include "typedef.h"
2
/***** This file contains some routines for input/output *****/
3
4
5
/*****************************************************\
6
| gets the options from the command line
7
\*****************************************************/
8
static void getflags(fl, options)
9
flagstruct *fl;
10
int *options;
11
{
12
if(options == NULL)
13
{
14
fl->DEPTH = 0;
15
fl->STAB = 0;
16
fl->PRINT = 0;
17
fl->BACH[0] = fl->BACH[1] = fl->BACH[2] = 0;
18
fl->BACHDEP = 0;
19
fl->BACHSCP = 0;
20
return;
21
}
22
23
/* depth for the scalar product combinations */
24
if(options[0] >= 0)
25
fl->DEPTH = options[0] ;
26
else
27
fl->DEPTH = 0;
28
/* only the point stabilizer of the first STAB basis-vectors will be computed */
29
if(options[1] >= 0)
30
fl->STAB = options[1];
31
else
32
fl->STAB = 0;
33
/* flag that every new generator is immediately written on the file AUTO.tmp */
34
if(options[2] == 1)
35
fl->PRINT = 1;
36
else
37
fl->PRINT = 0;
38
/* flag that Bacher-polynomials will be used */
39
if(options[3]==1 || options[3]==2 || options[3]==3 || options[3]==4)
40
fl->BACH[0] = 1;
41
else
42
fl->BACH[0] = 0;
43
/* flag that the depth for the Bacher-polynomials is given as an argument,
44
default is 1 */
45
if(options[3]==2 || options[3]==4)
46
fl->BACH[1] = 1;
47
else
48
fl->BACH[1] = 0;
49
/* flag that the scalar product for the Bacher-polynomials is given as an
50
argument, default is 1/2*norm of the vector */
51
if(options[3]==3 || options[3]==4)
52
fl->BACH[2] = 1;
53
else
54
fl->BACH[2] = 0;
55
56
/* depth for the Bacher-polynomials */
57
if(fl->BACH[1] == 1 && options[4] > 0)
58
fl->BACHDEP = options[4];
59
else
60
fl->BACHDEP = 1;
61
if(fl->BACH[0] == 0)
62
fl->BACHDEP = 0;
63
/* scalar product for the Bacher-polynomials */
64
if(fl->BACH[2] == 1)
65
fl->BACHSCP = options[5];
66
else
67
fl->BACHSCP = 0;
68
}
69
70
71
72
73
74
/**************************************************************\
75
| saves the generators of the group, which are
76
| necessary for generating, in a bravais_TYP.
77
\**************************************************************/
78
static bravais_TYP *putgens(G, flags)
79
group G;
80
flagstruct flags;
81
{
82
int i, j, k, l, dim, ngen, nr;
83
bravais_TYP *B;
84
extern matrix_TYP *init_mat();
85
86
B = (bravais_TYP *)malloc(sizeof(bravais_TYP));
87
B->gen_no = 0;
88
B->form_no = 0;
89
B->zentr_no = 0;
90
B->normal_no = 0;
91
B->cen_no = 0;
92
B->dim = G.dim;
93
94
dim = G.dim;
95
ngen = 0;
96
for (i = flags.STAB; i < dim; ++i)
97
ngen += G.ng[i] - G.nsg[i];
98
B->gen_no = ngen;
99
if(ngen > 0)
100
{
101
if((B->gen = (matrix_TYP **)malloc(ngen *sizeof(matrix_TYP *))) == 0)
102
{
103
printf("malloc of 'B->gen' in 'putgens' failed\n");
104
exit(2);
105
}
106
}
107
nr = 0;
108
for (i = flags.STAB; i < dim; ++i)
109
{
110
for (j = G.nsg[i]; j < G.ng[i]; ++j)
111
{
112
B->gen[nr] = init_mat(dim,dim, "");
113
for (k = 0; k < dim; ++k)
114
for (l = 0; l < dim; ++l)
115
B->gen[nr]->array.SZ[k][l] = G.g[i][j][l][k];
116
++nr;
117
}
118
}
119
return(B);
120
}
121
122
/*********************************************************************\
123
| writes the prime power decomposition
124
| of G.ord[flags.STAB] *...* G.ord[G.dim-1] to B->divisors
125
\*********************************************************************/
126
static void putord(G, flags, B)
127
group G;
128
flagstruct flags;
129
bravais_TYP *B;
130
{
131
int i, j, dim, fac;
132
133
dim = G.dim;
134
for (i = 0; i < 100; ++i)
135
B->divisors[i] = 0;
136
B->divisors[1] = 1;
137
B->order = 1;
138
for (i = flags.STAB; i < dim; ++i)
139
{
140
fac = G.ord[i];
141
B->order *= fac;
142
for (j = 2; j <= dim+1 && fac != 1; ++j)
143
{
144
if (fac % j == 0)
145
{
146
++(B->divisors[j]);
147
fac = fac / j;
148
--j;
149
}
150
}
151
}
152
}
153
154
/*******************************************************\
155
| prints an isometry onto a matrix
156
\*******************************************************/
157
static matrix_TYP *putiso(X, flags, dim)
158
int **X, dim;
159
flagstruct flags;
160
{
161
int i, j;
162
matrix_TYP *M;
163
extern matrix_TYP *init_mat();
164
165
M = init_mat(dim, dim, "");
166
for (i = 0; i < dim; ++i)
167
for (j = 0; j < dim; ++j)
168
M->array.SZ[i][j] = X[i][j];
169
return(M);
170
}
171
172