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

563516 views
1
#include"typedef.h"
2
#include"getput.h"
3
#include"bravais.h"
4
#include"matrix.h"
5
6
int INFO_LEVEL;
7
8
int main (int argc, char *argv[])
9
{
10
int i,j,anz, prime;
11
int sym_opt;
12
bravais_TYP *B;
13
matrix_TYP **F;
14
char comment[80];
15
16
read_header(argc, argv);
17
if(FILEANZ != 1)
18
{
19
printf("Usage: Form_space 'file' [-a] [-s] [-p=prime]\n");
20
printf("\n");
21
printf("file: bravais_TYP containing the unimodular group G.\n");
22
printf("\n");
23
printf("Calculates a Z-basis for the space of matrices A with g^tr * A * g = A\n");
24
printf("for all g in G. Default: A is symmetric.\n");
25
printf("\n");
26
printf("Options:\n");
27
printf("-a: all invariant matrices are calculated\n");
28
printf("-s: only the skew-symmetric invariant matrices are calculated\n");
29
printf("-p=prime: the mod-p-invariant matrices, and a basis over Z/pZ is given.\n");
30
printf(" The default prime is 101. \n");
31
printf("\n");
32
printf("Cf. Invar_space\n");
33
if (is_option('h')){
34
exit(0);
35
}
36
else{
37
exit(31);
38
}
39
}
40
B = get_bravais(FILENAMES[0]);
41
sym_opt = 1;
42
if(is_option('a') == TRUE)
43
sym_opt = 0;
44
if(is_option('s') == TRUE)
45
sym_opt = -1;
46
if(is_option('p'))
47
{
48
if(optionnumber('p') == 0)
49
prime = 101;
50
else
51
prime = optionnumber('p');
52
F = p_formspace(B->gen, B->gen_no, prime, sym_opt, &anz);
53
sprintf(comment, "invariant martrix modulo %d", prime);
54
printf("#%d\n", anz);
55
for(i=0;i<anz;i++)
56
put_mat(F[i], NULL, comment, 2);
57
}
58
else
59
{
60
F = formspace(B->gen, B->gen_no, sym_opt, &anz);
61
printf("#%d\n", anz);
62
for(i=0;i<anz;i++)
63
put_mat(F[i], NULL, "invariant matrix", 2);
64
}
65
66
exit(0);
67
}
68
69