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

563604 views
1
#include "typedef.h"
2
#include "idem.h"
3
#include "matrix.h"
4
#include "bravais.h"
5
#include "longtools.h"
6
#include "tools.h"
7
8
matrix_TYP *almost_decomposable_lattice(bravais_TYP *G)
9
{
10
11
int i,
12
j,
13
k,
14
dimc,
15
dimcc,
16
col,
17
den,
18
IDEM_NO;
19
20
matrix_TYP *id,
21
*F,
22
**IDEM_SPACES,
23
**IDEM,
24
*new_base,
25
*tmp;
26
27
28
id = init_mat(G->dim,G->dim,"1");
29
30
/* we need a G-invariant, positive definite form for various reasons */
31
F = rform(G->gen,G->gen_no,id,101);
32
33
34
/* get the idempotents of the group */
35
IDEM = idempotente(G->gen,G->gen_no,F,&IDEM_NO,&dimc,&dimcc,NULL);
36
IDEM_SPACES = (matrix_TYP **) malloc(IDEM_NO * sizeof(matrix_TYP *));
37
den = 1; for (i=0;i<IDEM_NO;i++) den = KGV(den,IDEM[i]->kgv);
38
for (i=0;i<IDEM_NO;i++){
39
/* tmp = tr_pose(IDEM[i]);
40
IDEM_SPACES[i] = long_rein_mat(tmp);
41
free_mat(tmp); */
42
tmp = tr_pose(IDEM[i]);
43
tmp->kgv = 1; iscal_mul(tmp,den / IDEM[i]->kgv);
44
j = long_row_gauss(tmp);
45
real_mat(tmp,j,tmp->cols);
46
IDEM_SPACES[i] = tmp;
47
}
48
49
new_base = init_mat(G->dim,G->dim,"0");
50
col = -1;
51
for (i=0;i<IDEM_NO;i++){
52
for (j=0;j<IDEM_SPACES[i]->rows;j++){
53
col++;
54
for (k=0;k<G->dim;k++){
55
new_base->array.SZ[k][col] = IDEM_SPACES[i]->array.SZ[j][k];
56
}
57
}
58
}
59
60
Check_mat(new_base);
61
tmp = mat_inv(new_base); tmp->kgv=1; Check_mat(tmp);
62
free_mat(new_base);
63
for (i=0;i<IDEM_NO;i++){
64
free_mat(IDEM_SPACES[i]);
65
}
66
for (i=0;i<IDEM_NO+dimc+dimcc;i++){
67
free_mat(IDEM[i]);
68
}
69
free(IDEM_SPACES);
70
free(IDEM);
71
free_mat(F);
72
free_mat(id);
73
74
return tmp;
75
76
}
77
78