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 anz,
9
i,
10
j,
11
k,
12
rows,
13
cols;
14
15
char comment[1000];
16
17
matrix_TYP **F,
18
*tmp;
19
20
read_header(argc, argv);
21
if(FILEANZ < 1 || is_option('h'))
22
{
23
printf("Usage: Mtl file\n");
24
printf("\n");
25
printf(" where file contains a matrix_TYP.\n");
26
printf("\n");
27
printf("Writes the entries of the matrices given in file in ONE\n");
28
printf("matrix, which rows consists of the concatenation of the\n");
29
printf("rows of the individual matrices in file.\n");
30
printf("Note that this function does exactly the inverse of Ltm!\n");
31
printf("\n");
32
if (is_option('h')){
33
exit(0);
34
}
35
else{
36
exit(31);
37
}
38
}
39
40
F = mget_mat(FILENAMES[0],&anz);
41
42
rows = F[0]->rows;
43
cols = F[0]->cols;
44
45
tmp = init_mat(anz,rows*cols,"r");
46
47
for (i=0;i<anz;i++){
48
rat2kgv(F[i]);
49
if (rows != F[i]->rows){
50
printf("The given matrices must all have the same number of rows.\n");
51
exit(3);
52
}
53
if (cols != F[i]->cols){
54
printf("The given matrices must all have the same number of columns.\n");
55
exit(3);
56
}
57
for (j=0;j<cols;j++){
58
for (k=0;k<rows;k++){
59
tmp->array.SZ[i][cols*k+j] = F[i]->array.SZ[k][j];
60
tmp->array.N[i][cols*k+j] = F[i]->kgv;
61
}
62
}
63
}
64
65
rat2kgv(tmp);
66
Check_mat(tmp);
67
68
sprintf(comment,"Mtl on file %s",FILENAMES[0]);
69
70
put_mat(tmp,NULL,comment,2);
71
72
73
exit(0);
74
}
75
76
77