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
#include "name.h"
3
#include "tools.h"
4
#include "matrix.h"
5
#include "getput.h"
6
#include "bravais.h"
7
#include "contrib.h"
8
#include "sort.h"
9
#include "datei.h"
10
11
/*************************************************************************
12
@
13
@ matrix_TYP *q_class_inf (bravais_TYP *G,
14
@ database *database,
15
@ char *qclass_name,
16
@ char *symbol,
17
@ bravais_TYP **OUT,
18
@ matrix_TYP **PRES,
19
@ int transformation)
20
@
21
@ SIDEEFECTS: G->gen[i] might be checked via Check_mat.
22
@ G->order and G->divisors WILL be set to the correct value.
23
**************************************************************************/
24
matrix_TYP *q_class_inf (bravais_TYP *G,
25
database *database,
26
char *qclass_name,
27
char *symbol,
28
bravais_TYP **OUT,
29
matrix_TYP **PRES,
30
int transformation)
31
{
32
33
bravais_TYP *H;
34
35
matrix_TYP *DATABASE_MAT,
36
*MATG,
37
*ERG = NULL;
38
39
char filetmp[1024];
40
41
int i,
42
orderG = 0,
43
possible[1024],
44
no_possible = 0;
45
46
MATG = compute_q_matrix (G);
47
48
for (i=0;i<MATG->cols;i++)
49
orderG += MATG->array.SZ[0][i];
50
51
G->order = orderG;
52
factorize_new(G->order,G->divisors);
53
54
for (i=0;i<database->nr;i++){
55
if (orderG == database->entry[i].order &&
56
G->dim == database->entry[i].degree &&
57
MATG->rows == database->entry[i].no_idem + 9 &&
58
MATG->cols == database->entry[i].no_conclass ){
59
60
sprintf(filetmp,"%s/tables/qcatalog/dim%d/dir.%s/ordnung.%d/%s/char.%s",
61
TOPDIR,G->dim,database->entry[i].symbol,
62
orderG,database->entry[i].discriminant,
63
database->entry[i].abbreviation);
64
65
DATABASE_MAT = get_mat(filetmp);
66
if (mat_comp(MATG,DATABASE_MAT) == 0){
67
possible[no_possible] = i;
68
no_possible++;
69
}
70
71
free_mat(DATABASE_MAT);
72
}
73
}
74
75
76
/* there are 5 pairs of groups where the characteristic matrix does
77
not decide the Q-equivalence. In these cases, get the hands dirty */
78
while (no_possible > 1) {
79
i = possible[no_possible-1];
80
sprintf(filetmp,"%s/tables/qcatalog/dim%d/dir.%s/ordnung.%d/%s/%s",
81
TOPDIR,G->dim,database->entry[i].symbol,
82
orderG,database->entry[i].discriminant,
83
database->entry[i].abbreviation);
84
85
H = get_bravais(filetmp);
86
ERG = suche_kand (G, H);
87
88
if (ERG == 0){
89
no_possible--;
90
free_bravais(H);
91
}
92
else{
93
possible[0] = i;
94
no_possible = 1;
95
if (OUT){
96
*OUT = H;
97
}
98
else{
99
free_bravais(H);
100
}
101
}
102
}
103
104
/* just for sanity */
105
if (no_possible == 0){
106
fprintf(stderr,"This group does not appear in the catalog of Q-classes.\n");
107
fprintf(stderr,"Please verify that CARAT has been installed properly.\n");
108
fprintf(stderr,"If so, please send a bug-report to\n");
109
fprintf(stderr," [email protected]\n");
110
fprintf(stderr,"including the forthcoming output.\n");
111
put_bravais(G,NULL,NULL);
112
exit(4);
113
}
114
115
if (OUT || (transformation && !ERG) ){
116
i = possible[0];
117
sprintf(filetmp,"%s/tables/qcatalog/dim%d/dir.%s/ordnung.%d/%s/%s",
118
TOPDIR,G->dim,database->entry[i].symbol,
119
orderG,database->entry[i].discriminant,
120
database->entry[i].abbreviation);
121
122
H = get_bravais(filetmp);
123
124
if (OUT){
125
*OUT = H;
126
}
127
128
}
129
130
if (PRES){
131
i = possible[0];
132
sprintf(filetmp,"%s/tables/qcatalog/dim%d/dir.%s/ordnung.%d/%s/pres.%s",
133
TOPDIR,G->dim,database->entry[i].symbol,
134
orderG,database->entry[i].discriminant,
135
database->entry[i].abbreviation);
136
137
*PRES = get_mat(filetmp);
138
}
139
140
/* now we have a group which fits to G, lets see what we want to
141
return as additional information */
142
if (transformation && !ERG){
143
144
ERG = suche_kand (G, H);
145
146
if (OUT){
147
*OUT = H;
148
}
149
else{
150
free_bravais(H);
151
}
152
153
if (!ERG){
154
fprintf(stderr,"This group does not appear in the catalog of Q-classes.\n");
155
fprintf(stderr,"Please verify that CARAT has been installed properly.\n");
156
fprintf(stderr,"If so, please send a bug-report to\n");
157
fprintf(stderr," [email protected]\n");
158
fprintf(stderr,"including the forthcoming output.\n");
159
put_bravais(G,NULL,NULL);
160
exit(4);
161
}
162
}
163
164
i = possible[no_possible-1];
165
if (qclass_name)
166
sprintf(qclass_name,"%s",database->entry[i].abbreviation);
167
168
if (symbol)
169
sprintf(symbol,"%s",database->entry[i].symbol);
170
171
free_mat(MATG);
172
173
return ERG;
174
175
}
176
177
178