CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

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

Views: 418384
1
/* author: Oliver Heidbuechel */
2
/* last change: 14.09.2000 */
3
4
5
#include <ZZ.h>
6
#include<typedef.h>
7
#include<getput.h>
8
#include<matrix.h>
9
#include<longtools.h>
10
#include<tools.h>
11
#include"zass.h"
12
#include <base.h>
13
#include <bravais.h>
14
#include <graph.h>
15
#include <presentation.h>
16
17
18
19
int INFO_LEVEL;
20
extern int SFLAG;
21
boolean GRAPH_DEBUG;
22
23
24
main (int argc, char *argv[])
25
{
26
matrix_TYP **presentation,
27
*erg,
28
**base;
29
30
bahn **strong;
31
32
bravais_TYP *G;
33
34
Q_data_TYP *data;
35
36
int i,
37
panz,
38
OPT[6],
39
U[6], O[6];
40
41
42
43
read_header(argc, argv);
44
if (FILEANZ < 1 || FILEANZ > 2 || (is_option('h') && optionnumber('h') == 0)){
45
printf("\n");
46
printf("Usage: %s 'file1' [-h] [-o] [-i] [-f] ['file2']\n",argv[0]);
47
printf("\n");
48
printf("file1: REDUCED pointgroup G with CORRECT order\n");
49
printf("file2: (Optional) Presentation of G\n");
50
printf("\n");
51
printf("Calculates the graph of inclusions of the Q-class given by G.\n");
52
printf("For further information on the output see example 13 of\n");
53
printf("the CARAT introduction (http://wwwb.math.rwth-aachen.de/carat).\n");
54
printf("\n");
55
printf("Options:\n");
56
printf("-h : Give this help.\n");
57
printf("-o : Do not calculate the corresponding supergroup numbers.\n");
58
printf(" The programm is faster then.\n");
59
printf("-i : Print the Z-classes to 'file1.i' and the affine classes\n");
60
printf(" to 'file1.i.j',\n");
61
printf("-f : Recalculate the formspace even if it is given.\n");
62
printf("-d : Only for debugging!\n");
63
printf("\n");
64
printf("CAUTION: If the formspace and the normalizer are given,\n");
65
printf(" they have to be correct.\n");
66
printf("\n");
67
printf("Cf.: KSupergroups, KSubgroups\n");
68
printf("\n");
69
exit(11);
70
}
71
72
INFO_LEVEL = optionnumber('h');
73
if (INFO_LEVEL & 12){
74
SFLAG = 1;
75
}
76
77
/* get data */
78
G = get_bravais(FILENAMES[0]);
79
80
81
/* trivial cases */
82
if (G->order == 0){
83
printf("There is 1 Z-Class with 1 Space Group!\n");
84
erg = init_mat(1,1,"");
85
put_mat(erg,0,0,0);
86
free_mat(erg);
87
free_bravais(G);
88
exit(0);
89
}
90
if (G->order == 2){
91
for (i = 0 ; i < G->gen_no; i++){
92
if (!G->gen[i]->flags.Scalar){
93
break;
94
}
95
}
96
if (i == G->gen_no){
97
U[0] = 2; U[1] = 6; U[2] = 14; U[3] = 30; U[4] = 62; U[5] = 126;
98
O[0] = 1; O[1] = 3; O[2] = 7; O[3] = 15; O[4] = 31; O[5] = 63;
99
printf("There is 1 Z-Class with 1 Space Group!\n");
100
printf("1: 1 (%i", U[G->dim - 1]);
101
if (!is_option('o'))
102
printf(", %i", O[G->dim - 1]);
103
printf(", 2^1)\n");
104
erg = init_mat(1,1,"1");
105
put_mat(erg,0,0,0);
106
free_bravais(G);
107
free_mat(erg);
108
exit(0);
109
}
110
}
111
112
/* get more data */
113
if (FILEANZ == 2){
114
presentation = mget_mat(FILENAMES[1],&panz);
115
if (panz > 1){
116
fprintf(stderr, "You should only give a single matrix as presention!\n");
117
exit(12);
118
}
119
}
120
else{
121
base = get_base(G);
122
strong = strong_generators(base,G,TRUE);
123
presentation = (matrix_TYP **)calloc(1, sizeof(matrix_TYP *));
124
OPT[0] = 0;
125
presentation[0] = pres(strong, G, OPT);
126
}
127
if (G->form == NULL || G->form_no == 0 || is_option('f')){
128
if (G->form != NULL){
129
for (i=0; i< G->form_no; i++)
130
free_mat(G->form[i]);
131
free(G->form);
132
}
133
G->form = formspace(G->gen,G->gen_no,1, &G->form_no);
134
}
135
if (is_option('d')){
136
GRAPH_DEBUG = TRUE;
137
}
138
data = get_Q_data(G, presentation[0], is_option('l'));
139
140
/* write informations about the Q-class */
141
put_Q_data(data, FILENAMES[0], is_option('i'));
142
143
/* calculate the graph */
144
erg = subgroupgraph(data, !is_option('o'));
145
put_mat(erg,0,0,0);
146
147
148
/* clean up */
149
free_mat(erg);
150
free_Q_data(data);
151
free_mat(presentation[0]);
152
free(presentation);
153
if (FILEANZ == 1){
154
for (i = 0; i < G->dim; i++){
155
free_mat(base[i]);
156
free_bahn(strong[i]);
157
free(strong[i]);
158
}
159
free(strong);
160
free(base);
161
}
162
free_bravais(G);
163
164
/* for debugging */
165
if (INFO_LEVEL & 12){
166
fprintf(stderr,"write pointer_statistics\n");
167
pointer_statistics(0,0);
168
}
169
170
exit(0);
171
}
172
173
174
175
176
177
178
179