GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
#include "typedef.h"1#include "matrix.h"2/**************************************************************************\3@---------------------------------------------------------------------------4@---------------------------------------------------------------------------5@ FILE: tr_pose_mat.c6@---------------------------------------------------------------------------7@---------------------------------------------------------------------------8@9\**************************************************************************/1011/**************************************************************************\12@---------------------------------------------------------------------------13@ matrix_TYP *tr_pose(mat)14@ matrix_TYP *mat;15@16@ calculates the tansposed of mat.17@---------------------------------------------------------------------------18@19\**************************************************************************/2021/*{{{}}}*/22/*{{{ tr_pose*/23matrix_TYP *tr_pose(mat)24matrix_TYP *mat;25{26int i,j;27matrix_TYP *cmat;28int **cZ, **cN, **Z, **N;2930if (mat->array.N != NULL ) {31cmat = init_mat(mat->cols,mat->rows,"r");32N = mat->array.N;33cN = cmat->array.N;34} else{35cmat = init_mat(mat->cols,mat->rows,"");36}37Z = mat->array.SZ;38cZ = cmat->array.SZ;3940cmat->flags = mat->flags;4142cmat->kgv= mat->kgv;43cmat->prime = mat->prime;4445for(i = 0; i < cmat->rows; i++) {46for(j = 0; j < cmat->cols; j++) {47cZ[i][j] = Z[j][i];48}49}50if( cmat->array.N != NULL) {51for(i = 0; i < cmat->rows; i++) {52for(j = 0; j < cmat->cols; j++) {53cN[i][j] = N[j][i];54}55}56}57return cmat;58}5960/*}}} */61626364