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**Binv,16*tmp,17*tmp2;1819char comment[1000];2021read_header(argc, argv);22if(FILEANZ < 2)23{24printf("Usage: %s 'file1' 'file2' [-x]\n",argv[0]);25printf("\n");26printf("file1: matrix_TYP containing matrices A_i\n");27printf("file2: matrix_TYP containing matrices B_j\n");28printf("\n");29printf("Conjugates the i-th matrix of file1 with the i-th matrix of\n");30printf("file2, i.e. performs products of the form B_i * A_i * B_i^-1.\n");31printf("\n");32printf("Options:\n");33printf("-x: Conjugates all matrices of file1 with all matrices\n");34printf(" of file2, i.e. performs all products of the for B_j * A_i * B_j^-1.\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);4546Binv = (matrix_TYP **) malloc(anz2 * sizeof(matrix_TYP *));4748for (i=0;i<anz2;i++){49Binv[i] = mat_inv(B[i]);50}5152if (anz1<anz2){53min = anz1;54}55else{56min = anz2;57}5859if (is_option('x')){60printf("#%d\n",anz1*anz2);61for (i=0;i<anz1;i++){62for (j=0;j<anz2;j++){63tmp2 = mat_mul(A[i],Binv[j]);64tmp = mat_mul(B[j],tmp2);65free_mat(tmp2);66sprintf(comment,67"B*A*B^{-1} for A = %d-th matrix of %s, B= %d-th matrix of %s",68i+1,FILENAMES[0],j+1,FILENAMES[1]);69put_mat(tmp,NULL,comment,2);70free_mat(tmp);71}72}73}74else{75printf("#%d\n",min);76for (i=0;i<min;i++){77tmp2 = mat_mul(A[i],Binv[i]);78tmp = mat_mul(B[i],tmp2);79free_mat(tmp2);80sprintf(comment,81"B*A*B^{-1} for A = %d-th matrix of %s, B= %d-th matrix of %s",82i+1,FILENAMES[0],i+1,FILENAMES[1]);83put_mat(tmp,NULL,comment,2);84free_mat(tmp);85}86}8788exit(0);89}909192