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"45int INFO_LEVEL;67int main (int argc, char *argv[])8{9int i,j,anz, prime;10int sym_opt;11bravais_TYP *B;12matrix_TYP **F;13char comment[80];1415read_header(argc, argv);16if(FILEANZ != 1)17{18printf("Usage: Form_space 'file' [-a] [-s] [-p=prime]\n");19printf("\n");20printf("file: bravais_TYP containing the unimodular group G.\n");21printf("\n");22printf("Calculates a Z-basis for the space of matrices A with g^tr * A * g = A\n");23printf("for all g in G. Default: A is symmetric.\n");24printf("\n");25printf("Options:\n");26printf("-a: all invariant matrices are calculated\n");27printf("-s: only the skew-symmetric invariant matrices are calculated\n");28printf("-p=prime: the mod-p-invariant matrices, and a basis over Z/pZ is given.\n");29printf(" The default prime is 101. \n");30printf("\n");31printf("Cf. Invar_space\n");32if (is_option('h')){33exit(0);34}35else{36exit(31);37}38}39B = get_bravais(FILENAMES[0]);40sym_opt = 1;41if(is_option('a') == TRUE)42sym_opt = 0;43if(is_option('s') == TRUE)44sym_opt = -1;45if(is_option('p'))46{47if(optionnumber('p') == 0)48prime = 101;49else50prime = optionnumber('p');51F = p_formspace(B->gen, B->gen_no, prime, sym_opt, &anz);52sprintf(comment, "invariant martrix modulo %d", prime);53printf("#%d\n", anz);54for(i=0;i<anz;i++)55put_mat(F[i], NULL, comment, 2);56}57else58{59F = formspace(B->gen, B->gen_no, sym_opt, &anz);60printf("#%d\n", anz);61for(i=0;i<anz;i++)62put_mat(F[i], NULL, "invariant matrix", 2);63}6465exit(0);66}676869