GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
#include"typedef.h"123main (int argc, char *argv[])4{56matrix_TYP **Mat;7matrix_TYP **F, *V;8bravais_TYP *G;9int i, d, Fanz, anz;1011extern char **FILENAMES;12extern int FILEANZ;1314extern matrix_TYP **mget_mat();15extern bravais_TYP *get_bravais();16extern matrix_TYP *init_mat();17extern void put_mat ();18extern void form_to_vec();1920read_header(argc, argv);21if(FILEANZ != 2 || (is_option('h') && optionnumber('h') == 0))22{23printf("Usage: %s 'file1' 'file2' [-m] [-d]\n",argv[0]);24printf("\n");25printf(" file1: matrix_TYP\n");26printf(" file2: matrix_TYP or bravais_TYP.\n");27printf("\n");28printf("For each matrix A in file1 a vector V is calculated\n");29printf("with the following property:\n");30printf(" A = 1/V[NO+1] * (V[1] * F_1 + V[2] * F_2 +...+ V[NO] * F_NO),\n");31printf("Where is F_i are the matrices in file2 if file2 is a\n");32printf("matrix_TYP, otherwise are the matrices describing the\n");33printf("form space of the bravais group in file2.\n");34printf("CAUTION: if not used with the option -d, the denominator\n");35printf(" is not printed, so you will get a vector with\n");36printf(" only NO columns.\n");37printf("\n");38printf("Options:\n");39printf(" -m: Use a modular (but exact) method to calculate \n");40printf(" the result. The result is calculated for a couple\n");41printf(" of big primes and fitted together with the chinese\n");42printf(" remainder theorem.\n");43printf(" This method is much faster and avoids trouble with\n");44printf(" overflow, BUT IS ABLE TO HANDLE THE CASE V[NO+1] == 1\n");45printf(" ONLY (AND WILL RUN INTO AN INFINITE LOOP OTHERWISE).\n");46printf(" -d: give the denominator in the NO+1-th colunm.\n");47printf("\n");48printf("\n");49if (is_option('h')){50exit(0);51}52else{53exit(31);54}55}56Mat = mget_mat (FILENAMES[0], &anz);57G = get_bravais(FILENAMES[1]);58if(G->form_no > 0)59{ F = G->form; Fanz = G->form_no;}60else61{ F = G->gen; Fanz = G->gen_no;}62V = init_mat(anz, Fanz+1, "");63if(is_option('m') == TRUE)64{65for(i=0;i<anz;i++)66form_to_vec_modular(V->array.SZ[i], Mat[i], F, Fanz);67V->cols--;68}69else70{71for(i=0;i<anz;i++)72{73form_to_vec(V->array.SZ[i], Mat[i], F, Fanz, &d);74V->array.SZ[i][Fanz] = d;75}76if(is_option('d'))77V->cols = Fanz+1;78else79V->cols = Fanz;80}81put_mat(V, NULL, "matrices written as linear combination", 0);828384exit(0);85}868788