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

563580 views
1
#include "typedef.h"
2
#include "matrix.h"
3
/**************************************************************************\
4
@---------------------------------------------------------------------------
5
@---------------------------------------------------------------------------
6
@ FILE: tr_pose_mat.c
7
@---------------------------------------------------------------------------
8
@---------------------------------------------------------------------------
9
@
10
\**************************************************************************/
11
12
/**************************************************************************\
13
@---------------------------------------------------------------------------
14
@ matrix_TYP *tr_pose(mat)
15
@ matrix_TYP *mat;
16
@
17
@ calculates the tansposed of mat.
18
@---------------------------------------------------------------------------
19
@
20
\**************************************************************************/
21
22
/*{{{}}}*/
23
/*{{{ tr_pose*/
24
matrix_TYP *tr_pose(mat)
25
matrix_TYP *mat;
26
{
27
int i,j;
28
matrix_TYP *cmat;
29
int **cZ, **cN, **Z, **N;
30
31
if (mat->array.N != NULL ) {
32
cmat = init_mat(mat->cols,mat->rows,"r");
33
N = mat->array.N;
34
cN = cmat->array.N;
35
} else{
36
cmat = init_mat(mat->cols,mat->rows,"");
37
}
38
Z = mat->array.SZ;
39
cZ = cmat->array.SZ;
40
41
cmat->flags = mat->flags;
42
43
cmat->kgv= mat->kgv;
44
cmat->prime = mat->prime;
45
46
for(i = 0; i < cmat->rows; i++) {
47
for(j = 0; j < cmat->cols; j++) {
48
cZ[i][j] = Z[j][i];
49
}
50
}
51
if( cmat->array.N != NULL) {
52
for(i = 0; i < cmat->rows; i++) {
53
for(j = 0; j < cmat->cols; j++) {
54
cN[i][j] = N[j][i];
55
}
56
}
57
}
58
return cmat;
59
}
60
61
/*}}} */
62
63
64