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

563516 views
1
/* author: Oliver Heidbuechel */
2
/* last change: 07.02.2001 */
3
4
#include <ZZ.h>
5
#include<typedef.h>
6
#include<getput.h>
7
#include<matrix.h>
8
#include<longtools.h>
9
#include<tools.h>
10
#include"zass.h"
11
#include <base.h>
12
#include <bravais.h>
13
#include <graph.h>
14
#include <presentation.h>
15
16
17
int INFO_LEVEL;
18
extern int SFLAG;
19
boolean GRAPH_DEBUG;
20
21
22
23
int main (int argc, char *argv[])
24
{
25
bravais_TYP *G, *R, **S;
26
27
int i, anz, panz, OPT[6];
28
29
char comment[1000],
30
file[1000];
31
32
matrix_TYP **presentation,
33
**base;
34
35
bahn **strong;
36
37
38
read_header(argc, argv);
39
if ( (is_option('p') && FILEANZ < 4) || (!is_option('p') && FILEANZ < 3) ||
40
(is_option('h') && optionnumber('h') == 0) ){
41
printf("\n");
42
printf("Usage: %s 'file1' 'file2' [-p 'file3'] 'p_1' ... 'p_n' \n", argv[0]);
43
printf("\n");
44
printf("file1: Spacegroup R in standard affine form\n");
45
printf("file2: Pointgroup G of R (G->gen and G->normal have to generate the normalizer)\n");
46
printf("file3: (Optional) Presentation of G\n");
47
printf("p_i : primes\n");
48
printf("\n");
49
printf("Calculates the maximal klassengleich subgroups of R\n");
50
printf("with p_i-power index.\n");
51
printf("\n");
52
printf("Options:\n");
53
printf("-f : print the subgroups in files 'file1_j'\n");
54
printf("-h : gives this help\n");
55
printf("-d : only for debugging, do not use\n");
56
exit(11);
57
}
58
INFO_LEVEL = optionnumber('h');
59
if (INFO_LEVEL & 12){
60
SFLAG = 1;
61
}
62
63
/* get data */
64
R = get_bravais(FILENAMES[0]);
65
G = get_bravais(FILENAMES[1]);
66
memset(G->divisors, 0, 100 * sizeof(int));
67
if (is_option('p')){
68
presentation = mget_mat(FILENAMES[2], &panz);
69
if (panz > 1){
70
fprintf(stderr, "you should only give a single matrix as presention\n");
71
exit(3);
72
}
73
for (i = 3; i < FILEANZ; i++){
74
G->divisors[atoi(FILENAMES[i])]++;
75
}
76
}
77
else{
78
base = get_base(G);
79
strong = strong_generators(base,G,TRUE);
80
presentation = (matrix_TYP **)calloc(1, sizeof(matrix_TYP *));
81
presentation[0] = pres(strong, G, OPT);
82
for (i = 0; i < G->dim; i++){
83
free_mat(base[i]);
84
free_bahn(strong[i]);
85
free(strong[i]);
86
}
87
free(strong);
88
free(base);
89
for (i = 2; i < FILEANZ; i++){
90
G->divisors[atoi(FILENAMES[i])]++;
91
}
92
}
93
94
/* calculate the minimal klassengleich subgroups of prime-power-index */
95
S = max_k_sub(G, R, presentation[0], &anz, is_option('d'));
96
97
/* print the minimal klassengleich subgroups of prime-power-index */
98
if (is_option('f')){
99
for (i = 0; i < anz; i++){
100
sprintf(comment, "%d-th maximal klassengleich subgroup of %s", i + 1, FILENAMES[0]);
101
sprintf(file, "%s_%d", FILENAMES[0], i + 1);
102
put_bravais(S[i], file, comment);
103
}
104
}
105
else{
106
for (i = 0; i < anz; i++){
107
sprintf(comment, "%d-th maximal klassengleich subgroup of %s", i + 1, FILENAMES[0]);
108
put_bravais(S[i], 0, comment);
109
}
110
}
111
112
/* clean */
113
free_bravais(R);
114
free_bravais(G);
115
for (i = 0; i < anz; i++)
116
free_bravais(S[i]);
117
free(S);
118
free_mat(presentation[0]);
119
free(presentation);
120
121
/* for debugging */
122
if (INFO_LEVEL & 12){
123
fprintf(stderr,"write pointer_statistics\n");
124
pointer_statistics(0,0);
125
}
126
127
exit(0);
128
}
129
130
131
132
133
134
135
136