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"matrix.h"3456main (int argc, char *argv[])7{89matrix_TYP **x, **S, *E;10int anz1,11anz2,12i,13j;1415char comment[1000];1617read_header(argc, argv);18if(FILEANZ != 2)19{20printf("Usage: Mul 'file1' 'file2' [-x]\n");21printf("\n");22printf("file1: matrix_TYP containing the matrices A_i for 1<= i <= n.\n");23printf("file2: matrix_TYP containing the matrices B_j for 1<= j <= m.\n");24printf("\n");25printf("Multiply the matrices in 'file1' with those in 'file2'.\n");26printf("Called without any option the program ouptputs the products\n");27printf("A_k * B_k for 1 <= k <= Min(n,m).\n");28printf("\n");29printf("Options:\n");30printf(" -x : perform all products of the form A_i * B_j for 1 <= i <=n,\n");31printf(" 1 <= j <= m.\n");32printf("\n");33printf("Cf. Add\n");34if (is_option('h')){35exit(0);36}37else{38exit(31);39}40}41x = mget_mat(FILENAMES[0], &anz1);42S = mget_mat(FILENAMES[1], &anz2);4344if (is_option('x')){45printf("#%d\n",anz1*anz2);46for(i=0;i<anz1;i++){47for(j=0;j<anz2;j++){48sprintf(comment,"product of the %d-th matrix of %s with the %d-th matrix of %s",i+1,FILENAMES[0],j+1,FILENAMES[1]);49E = mat_mul(x[i], S[j]);50put_mat(E,NULL,comment,2);51free_mat(E);52}53}54}55else{56if (anz1>anz2) anz1 = anz2;57printf("#%d\n",anz1);58for(i=0;i<anz1;i++){59sprintf(comment,"product of the %d-th matrix of %s with the %d-th matrix of %s",i+1,FILENAMES[0],i+1,FILENAMES[1]);60E = mat_mul(x[i], S[i]);61put_mat(E,NULL,comment,2);62free_mat(E);63}64}6566exit(0);67}686970