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 i,8j,9anz1,10anz2,11min;1213matrix_TYP **A,14**B,15*tmp;1617char comment[1000];1819read_header(argc, argv);20if((FILEANZ < 2) || (is_option('h')))21{22printf("Usage: Kron 'file1' 'file2' [-x]\n");23printf("\n");24printf("file1: matrix_TYP.\n");25printf("file2: matrix_TYP.\n");26printf("\n");27printf("Calculates the Kronecker product of the matrices given\n");28printf("in file1 with those of file2.\n");29printf("\n");30printf("OPTIONS:\n");31printf("-x : Outputs every possible Kronecker product. If this option\n");32printf(" is not present, the Kronecker product of the i-th matrix\n");33printf(" of file1 with the i-th matrix of file2 is calculated.\n");34printf("\n");35if (is_option('h')){36exit(0);37}38else{39exit(31);40}41}4243A = mget_mat(FILENAMES[0],&anz1);44B = mget_mat(FILENAMES[1],&anz2);4546if (anz1<anz2){47min = anz1;48}49else{50min = anz2;51}5253if (is_option('x')){54printf("#%d\n",anz1*anz2);55for (i=0;i<anz1;i++){56for (j=0;j<anz2;j++){57tmp = kron_mat(A[j],B[i]);58sprintf(comment,59"Kronecker product of %d-th matrix of %s with %d-th matrix of %s",60j+1,FILENAMES[0],i+1,FILENAMES[1]);61put_mat(tmp,NULL,comment,2);62free_mat(tmp);63}64}65}66else{67printf("#%d\n",min);68for (i=0;i<min;i++){69tmp = kron_mat(A[i],B[i]);70sprintf(comment,71"Kronecker product of %d-th matrix of %s with %d-th matrix of %s",72i+1,FILENAMES[0],i+1,FILENAMES[1]);73put_mat(tmp,NULL,comment,2);74free_mat(tmp);75}76}777879exit(0);80}818283