GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
#include"typedef.h"1#include"getput.h"2#include"bravais.h"3#include"matrix.h"45main (int argc, char *argv[])6{7int anz,8i,9j,10k,11rows,12cols;1314char comment[1000];1516matrix_TYP **F,17*tmp;1819read_header(argc, argv);20if(FILEANZ < 1 || is_option('h'))21{22printf("Usage: Mtl file\n");23printf("\n");24printf(" where file contains a matrix_TYP.\n");25printf("\n");26printf("Writes the entries of the matrices given in file in ONE\n");27printf("matrix, which rows consists of the concatenation of the\n");28printf("rows of the individual matrices in file.\n");29printf("Note that this function does exactly the inverse of Ltm!\n");30printf("\n");31if (is_option('h')){32exit(0);33}34else{35exit(31);36}37}3839F = mget_mat(FILENAMES[0],&anz);4041rows = F[0]->rows;42cols = F[0]->cols;4344tmp = init_mat(anz,rows*cols,"r");4546for (i=0;i<anz;i++){47rat2kgv(F[i]);48if (rows != F[i]->rows){49printf("The given matrices must all have the same number of rows.\n");50exit(3);51}52if (cols != F[i]->cols){53printf("The given matrices must all have the same number of columns.\n");54exit(3);55}56for (j=0;j<cols;j++){57for (k=0;k<rows;k++){58tmp->array.SZ[i][cols*k+j] = F[i]->array.SZ[k][j];59tmp->array.N[i][cols*k+j] = F[i]->kgv;60}61}62}6364rat2kgv(tmp);65Check_mat(tmp);6667sprintf(comment,"Mtl on file %s",FILENAMES[0]);6869put_mat(tmp,NULL,comment,2);707172exit(0);73}74757677