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

563690 views
1
#include <typedef.h>
2
#include <getput.h>
3
#include <matrix.h>
4
#include <base.h>
5
6
#include <longtools.h>
7
#include <bravais.h>
8
#include <idem.h>
9
10
int INFO_LEVEL;
11
extern int SFLAG;
12
13
14
main(int argc,char **argv){
15
16
bravais_TYP *G;
17
18
matrix_TYP *form,
19
**idem,
20
*id;
21
22
int i,
23
anz,
24
dim,
25
dimc,
26
dimcc,
27
options[2];
28
29
char comment[1000];
30
31
read_header(argc,argv);
32
33
if ((is_option('h') && optionnumber('h')==0) || (FILEANZ < 1)){
34
printf("Usage: %s file [-d] [-o]\n",argv[0]);
35
printf("\n");
36
printf("file: bravais_TYP containing generators of a finite unimodular group.\n");
37
printf("\n");
38
printf("Calculates the central primitive idempotents of the rational commuting (or \n");
39
printf("equivalently envelloping) algebra of the group in file. (This is used\n");
40
printf("for splitting the natural module Q^n into homogeneous components.)\n");
41
printf("\n");
42
printf("CAUTION: The program might give wrong answers for degrees bigger than 6.\n");
43
printf("\n");
44
printf("Options:\n");
45
printf(" -d : Outputs the dimensions of the commuting algebra and its centre.\n");
46
printf(" -o : Gives a Z-basis of the commuting algebra and its centre.\n");
47
printf("\n");
48
if (is_option('h')){
49
exit(0);
50
}
51
else{
52
exit(31);
53
}
54
}
55
56
INFO_LEVEL = optionnumber('h');
57
58
if (INFO_LEVEL & 12){
59
SFLAG = 1;
60
}
61
62
G = get_bravais(FILENAMES[0]);
63
64
/* avoid silly mistakes */
65
for (i=0;i<G->gen_no;i++){
66
if (!G->gen[i]->flags.Integral){
67
fprintf(stderr,"The generators for the bravais group have to be\n");
68
fprintf(stderr,"integral.\n");
69
exit(3);
70
}
71
}
72
73
id = init_mat(G->dim,G->dim,"1");
74
form = rform(G->gen,G->gen_no,id,101);
75
76
idem = idempotente(G->gen,G->gen_no,form,&anz,&dimc,&dimcc,options);
77
78
printf("#%d\n",anz);
79
for (i=0;i<anz;i++){
80
sprintf(comment,"%d-th idempotent for group in %s",i+1,FILENAMES[0]);
81
put_mat(idem[i],NULL,comment,2);
82
}
83
84
if (is_option('o')){
85
/* tell the user the centralizer */
86
printf("#%d\n",dimc);
87
for (i=0;i<dimc;i++){
88
sprintf(comment,"centralizer of group in %s",FILENAMES[0]);
89
put_mat(idem[i+anz],NULL,comment,2);
90
}
91
/* and it's centre */
92
printf("#%d\n",dimcc);
93
for (i=0;i<dimc;i++){
94
sprintf(comment,"centre of centralizer for group in %s",FILENAMES[0]);
95
put_mat(idem[i+anz+dimc],NULL,comment,2);
96
}
97
}
98
if (is_option('d')){
99
printf("dimension of the centralizer: %d\n",dimc);
100
printf("dimension of it's centre: %d\n",dimcc);
101
}
102
103
for (i=0;i<anz+dimc+dimcc;i++){
104
free_mat(idem[i]);
105
}
106
107
if (idem != NULL) free(idem);
108
free_bravais(G);
109
free_mat(form);
110
free_mat(id);
111
112
if (INFO_LEVEL & 12){
113
pointer_statistics(0,0);
114
}
115
116
exit(0);
117
118
} /* main */
119
120