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

563680 views
1
#include"typedef.h"
2
#include"matrix.h"
3
#include"longtools.h"
4
#include"bravais.h"
5
/**************************************************************************\
6
@---------------------------------------------------------------------------
7
@---------------------------------------------------------------------------
8
@ FILE: konj_bravais.c
9
@---------------------------------------------------------------------------
10
@---------------------------------------------------------------------------
11
@
12
\**************************************************************************/
13
14
/**************************************************************************\
15
@---------------------------------------------------------------------------
16
@ bravais_TYP *konj_bravais(B, T)
17
@ bravais_TYP *B;
18
@ matrix_TYP *T;
19
@
20
@ calculates the group T B T^(-1)
21
@ all informations of B are transformed: B->gen, B->form,....
22
@---------------------------------------------------------------------------
23
@
24
\**************************************************************************/
25
26
27
bravais_TYP *konj_bravais(B, T)
28
bravais_TYP *B;
29
matrix_TYP *T;
30
{
31
int i,dim;
32
bravais_TYP *G;
33
matrix_TYP *Ti, *Titr, *waste;
34
35
G = init_bravais(B->dim);
36
Ti = long_mat_inv(T);
37
38
/* inserted tilman 11/4/97 */
39
if (B->order != 0){
40
G->order = B->order;
41
memcpy(G->divisors,B->divisors,100*sizeof(int));
42
}
43
44
if(B->gen_no != 0)
45
{
46
G->gen_no = B->gen_no;
47
if( (G->gen = (matrix_TYP **)malloc(B->gen_no *sizeof(matrix_TYP *))) == NULL)
48
{
49
printf("malloc of 'G->gen' in 'konj_bravais' failed\n");
50
exit(2);
51
}
52
for(i=0;i<B->gen_no;i++)
53
{
54
waste = mat_mul(T, B->gen[i]);
55
G->gen[i] = mat_mul(waste, Ti);
56
free_mat(waste);
57
}
58
}
59
60
if(B->form_no != 0)
61
{
62
Titr = tr_pose(Ti);
63
G->form_no = B->form_no;
64
if( (G->form = (matrix_TYP **)malloc(B->form_no *sizeof(matrix_TYP *))) == NULL)
65
{
66
printf("malloc of 'G->form' in 'konj_bravais' failed\n");
67
exit(2);
68
}
69
for(i=0;i<B->form_no;i++)
70
{
71
waste = mat_mul(Titr, B->form[i]);
72
G->form[i] = mat_mul(waste, Ti);
73
free_mat(waste);
74
}
75
free_mat(Titr);
76
/* don't do this, it causes trouble in normalizer because
77
normalizer assumes the space of forms is calculated in the above way:
78
long_rein_formspace(G->form,G->form_no,1); */
79
}
80
81
if(B->zentr_no != 0)
82
{
83
G->zentr_no = B->zentr_no;
84
if( (G->zentr = (matrix_TYP **)malloc(B->zentr_no *sizeof(matrix_TYP *))) == NULL)
85
{
86
printf("malloc of 'G->zentr' in 'konj_bravais' failed\n");
87
exit(2);
88
}
89
for(i=0;i<B->zentr_no;i++)
90
{
91
waste = mat_mul(T, B->zentr[i]);
92
G->zentr[i] = mat_mul(waste, Ti);
93
free_mat(waste);
94
}
95
}
96
97
if(B->normal_no != 0)
98
{
99
G->normal_no = B->normal_no;
100
if( (G->normal = (matrix_TYP **)malloc(B->normal_no *sizeof(matrix_TYP *))) == NULL)
101
{
102
printf("malloc of 'G->normal' in 'konj_bravais' failed\n");
103
exit(2);
104
}
105
for(i=0;i<B->normal_no;i++)
106
{
107
waste = mat_mul(T, B->normal[i]);
108
G->normal[i] = mat_mul(waste, Ti);
109
free_mat(waste);
110
}
111
}
112
113
if(B->cen_no != 0)
114
{
115
G->cen_no = B->cen_no;
116
if( (G->cen = (matrix_TYP **)malloc(B->cen_no *sizeof(matrix_TYP *))) == NULL)
117
{
118
printf("malloc of 'G->cen' in 'konj_bravais' failed\n");
119
exit(2);
120
}
121
for(i=0;i<B->cen_no;i++)
122
{
123
waste = mat_mul(T, B->cen[i]);
124
G->cen[i] = mat_mul(waste, Ti);
125
free_mat(waste);
126
}
127
}
128
129
free_mat(Ti);
130
return(G);
131
}
132
133