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: 418346
1
#include"typedef.h"
2
3
4
main (int argc, char *argv[])
5
{
6
7
matrix_TYP **Mat, *vecs, *represent;
8
bravais_TYP *G;
9
int orb_anz;
10
int *subdiv;
11
int *c, *f;
12
int i,j, anz;
13
14
extern char **FILENAMES;
15
extern int FILEANZ;
16
17
extern matrix_TYP **mget_mat();
18
extern bravais_TYP *get_bravais();
19
extern int *orbit_subdivision();
20
extern matrix_TYP *init_mat();
21
extern void put_mat ();
22
23
read_header(argc, argv);
24
if(FILEANZ != 2)
25
{
26
printf("usage: orbrep 'file1' 'file2',\n");
27
printf("where 'file1' contains a matrix_TYP and\n");
28
printf(" 'file2' contains a bravais_TYP\n");
29
if (is_option('h')){
30
exit(0);
31
}
32
else{
33
exit(31);
34
}
35
}
36
Mat = mget_mat (FILENAMES[0], &anz);
37
vecs = Mat[0];
38
G = get_bravais(FILENAMES[1]);
39
subdiv = orbit_subdivision(vecs, G, &orb_anz);
40
represent = init_mat(orb_anz, G->gen[0]->cols, "");
41
c = (int *)malloc(orb_anz *sizeof(int));
42
f = (int *)malloc(orb_anz *sizeof(int));
43
for(i=0;i<orb_anz;i++)
44
c[i] = 0;
45
for(i=0;i<vecs->rows;i++)
46
{
47
j = subdiv[i]-1;
48
if(c[j] == 0)
49
f[j] = i;
50
c[j]++;
51
}
52
for(i=0;i<orb_anz;i++)
53
{
54
for(j=0;j<G->gen[0]->cols;j++)
55
represent->array.SZ[i][j] = vecs->array.SZ[f[i]][j];
56
}
57
put_mat(represent, NULL, "representatives of the orbits", 0);
58
printf(" The length of the i-th orbit is:\n");
59
for(i=0;i<orb_anz;i++)
60
printf("%d ", 2 *c[i]);
61
printf("\n");
62
63
64
exit(0);
65
}
66
67