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
main (int argc, char *argv[])
7
{
8
int i,
9
j,
10
anz,
11
epsilon,
12
expected_dimension;
13
14
int sym_opt;
15
bravais_TYP *B;
16
matrix_TYP **F;
17
char comment[80];
18
19
read_header(argc, argv);
20
if(FILEANZ != 1)
21
{
22
printf("Usage: %s 'file' [-a] [-s] [-e=n] [-d=n]\n",argv[0]);
23
printf("\n");
24
printf("file: bravais_TYP containing a finite unimodular group G.\n");
25
printf("\n");
26
printf("Calculates a Z-basis for the space of matrices with g^{tr}Ag = A for all\n");
27
printf("g in G by a quick seminumerical algorithm with some random features. By \n");
28
printf("default all symmetric invariant matrices are calculated,\n");
29
printf("\n");
30
printf("Options:\n");
31
printf("-a: All invariant matrices are calculated.\n");
32
printf("-s: All skew-symmetric invariant matrices are calculated.\n");
33
printf("-e=n: Changes the default value of control parameter from 100 to n>100. \n");
34
printf("-d=n: The program will calculate n+1 elements F_0,..., F_n of the \n");
35
printf(" invariant space, then it calculates a Z-basis of the Q-span of\n");
36
printf(" F_0, ..., F_n intersected with Z^nxn.\n");
37
printf(" This option is only usefull if one knows the dimension of the \n");
38
printf(" space of invariant forms. By default this number is calculated \n");
39
printf(" by modular arithmetic.\n");
40
printf("\n");
41
printf("Cf. Form_space.\n");
42
if (is_option('h')){
43
exit(0);
44
}
45
else{
46
exit(31);
47
}
48
}
49
50
B = get_bravais(FILENAMES[0]);
51
sym_opt = 1;
52
53
if(is_option('a') == TRUE){
54
sym_opt = 0;
55
}
56
if(is_option('s') == TRUE){
57
sym_opt = -1;
58
}
59
60
if (is_option('d')){
61
expected_dimension = optionnumber('d');
62
}
63
else{
64
/* calculating the dimension over a prime field */
65
F = p_formspace(B->gen,B->gen_no,1949,sym_opt,&expected_dimension);
66
}
67
68
if(optionnumber('e') == 0)
69
epsilon = 101;
70
else
71
epsilon = optionnumber('e');
72
73
F = invar_space(B->gen, B->gen_no,expected_dimension,sym_opt,epsilon,&anz);
74
printf("#%d\n", anz);
75
for(i=0;i<anz;i++)
76
put_mat(F[i], NULL, "invariant matrix", 2);
77
78
exit(0);
79
}
80
81