CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

Views: 418346
1
#include"typedef.h"
2
#include"tools.h"
3
#include"matrix.h"
4
#include"getput.h"
5
6
7
main (int argc, char *argv[])
8
{
9
matrix_TYP **M,
10
*Trf;
11
int erg,
12
anz,
13
i;
14
15
read_header(argc, argv);
16
if(FILEANZ != 1)
17
{
18
printf("Usage: %s 'file' [-t]\n",argv[0]);
19
printf("\n");
20
printf("file: matrix_TYP containing rational matrices.\n");
21
printf("\n");
22
printf("Calculates for each matrix in file a Gauss reduced matrix (row reduced).\n");
23
printf("More precisely, by applying integral elementary transformations\n");
24
printf("from the left, a staircase form of the input matrix is achieved.\n");
25
printf("\n");
26
printf("CAUTION: The program works with single precision and should be used only\n");
27
printf(" for small examples.\n");
28
printf("\n");
29
printf("Options:\n");
30
printf(" -t : give the transforming matrices as well.\n");
31
printf("\n");
32
printf("Cf. Long_solve.\n");
33
if (is_option('h')){
34
exit(0);
35
}
36
else{
37
exit(31);
38
}
39
}
40
41
M = mget_mat(FILENAMES[0],&anz);
42
for (i=0;i<anz;i++){
43
Trf = init_mat(M[i]->rows, M[i]->rows, "");
44
erg = Trf_gauss(M[i], Trf);
45
put_mat(M[i], NULL, "row-gauss of matrix", 0);
46
if (is_option('t')) put_mat(Trf, NULL, "Transformtion matrix", 0);
47
free_mat(Trf);
48
free_mat(M[i]);
49
}
50
51
exit(0);
52
}
53
54