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

563582 views
1
#include <typedef.h>
2
#include <getput.h>
3
#include <matrix.h>
4
#include <base.h>
5
6
int INFO_LEVEL;
7
extern int SFLAG;
8
9
10
main(int argc,char **argv){
11
12
bravais_TYP *G;
13
14
matrix_TYP **base;
15
16
bahn **strong;
17
18
int i,
19
j,
20
l,
21
siz,
22
anz;
23
24
char comment[1000];
25
26
27
read_header(argc,argv);
28
29
if ((is_option('h') && optionnumber('h')==0) || (FILEANZ < 1)){
30
printf("Usage: %s 'file' [-o]\n",argv[0]);
31
printf("\n");
32
printf("file: bravais_TYP containing a finite matrix group G.\n");
33
printf("\n");
34
printf("Calculates the order of G via an Algorithm by Schreier and Sims.\n");
35
printf("Options:\n");
36
printf("\n");
37
printf("-O : writes the group to stdout again, including the order and\n");
38
printf(" a factorisation of it.\n");
39
printf("-o : write a factorisation and the order to stdout. This can\n");
40
printf(" be used to append it to a bravais_TYP.\n");
41
printf("\n");
42
printf("WARNING: THE PROGRAM WILL TERMINATE IFF THE GROUP IS FINITE.\n");
43
printf("\n");
44
printf("Cf. Is_finite\n");
45
if (is_option('h')){
46
exit(0);
47
}
48
else{
49
exit(31);
50
}
51
}
52
53
INFO_LEVEL = optionnumber('h');
54
55
if (INFO_LEVEL & 12){
56
SFLAG = 1;
57
}
58
59
G = get_bravais(FILENAMES[0]);
60
61
base = get_base(G);
62
63
strong = strong_generators(base,G,FALSE);
64
65
siz = G->order = size(strong);
66
67
memset(G->divisors,0,100*sizeof(int));
68
69
for (i=2;i<100;i++){
70
if ((siz % i) == 0){
71
siz /= i;
72
G->divisors[i]++;
73
i--;
74
}
75
}
76
77
if (is_option('o')){
78
fput_order(stdout,G->divisors,G->order);
79
}
80
if (is_option('O')){
81
put_bravais(G,NULL,NULL);
82
}
83
fprintf(stderr,"The order of the group is %d\n",G->order);
84
85
free_bravais(G);
86
for (i=0;i<G->dim;i++){
87
free_mat(base[i]);
88
free_bahn(strong[i]);
89
free(strong[i]);
90
}
91
free(strong);
92
free(base);
93
94
if (INFO_LEVEL & 12){
95
pointer_statistics(0,0);
96
}
97
98
exit(0);
99
100
} /* main */
101
102
103