GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
#include "typedef.h"1/***** This file contains some routines for input/output *****/234/*****************************************************\5| gets the options from the command line6\*****************************************************/7static void getflags(fl, options)8flagstruct *fl;9int *options;10{11if(options == NULL)12{13fl->DEPTH = 0;14fl->STAB = 0;15fl->PRINT = 0;16fl->BACH[0] = fl->BACH[1] = fl->BACH[2] = 0;17fl->BACHDEP = 0;18fl->BACHSCP = 0;19return;20}2122/* depth for the scalar product combinations */23if(options[0] >= 0)24fl->DEPTH = options[0] ;25else26fl->DEPTH = 0;27/* only the point stabilizer of the first STAB basis-vectors will be computed */28if(options[1] >= 0)29fl->STAB = options[1];30else31fl->STAB = 0;32/* flag that every new generator is immediately written on the file AUTO.tmp */33if(options[2] == 1)34fl->PRINT = 1;35else36fl->PRINT = 0;37/* flag that Bacher-polynomials will be used */38if(options[3]==1 || options[3]==2 || options[3]==3 || options[3]==4)39fl->BACH[0] = 1;40else41fl->BACH[0] = 0;42/* flag that the depth for the Bacher-polynomials is given as an argument,43default is 1 */44if(options[3]==2 || options[3]==4)45fl->BACH[1] = 1;46else47fl->BACH[1] = 0;48/* flag that the scalar product for the Bacher-polynomials is given as an49argument, default is 1/2*norm of the vector */50if(options[3]==3 || options[3]==4)51fl->BACH[2] = 1;52else53fl->BACH[2] = 0;5455/* depth for the Bacher-polynomials */56if(fl->BACH[1] == 1 && options[4] > 0)57fl->BACHDEP = options[4];58else59fl->BACHDEP = 1;60if(fl->BACH[0] == 0)61fl->BACHDEP = 0;62/* scalar product for the Bacher-polynomials */63if(fl->BACH[2] == 1)64fl->BACHSCP = options[5];65else66fl->BACHSCP = 0;67}686970717273/**************************************************************\74| saves the generators of the group, which are75| necessary for generating, in a bravais_TYP.76\**************************************************************/77static bravais_TYP *putgens(G, flags)78group G;79flagstruct flags;80{81int i, j, k, l, dim, ngen, nr;82bravais_TYP *B;83extern matrix_TYP *init_mat();8485B = (bravais_TYP *)malloc(sizeof(bravais_TYP));86B->gen_no = 0;87B->form_no = 0;88B->zentr_no = 0;89B->normal_no = 0;90B->cen_no = 0;91B->dim = G.dim;9293dim = G.dim;94ngen = 0;95for (i = flags.STAB; i < dim; ++i)96ngen += G.ng[i] - G.nsg[i];97B->gen_no = ngen;98if(ngen > 0)99{100if((B->gen = (matrix_TYP **)malloc(ngen *sizeof(matrix_TYP *))) == 0)101{102printf("malloc of 'B->gen' in 'putgens' failed\n");103exit(2);104}105}106nr = 0;107for (i = flags.STAB; i < dim; ++i)108{109for (j = G.nsg[i]; j < G.ng[i]; ++j)110{111B->gen[nr] = init_mat(dim,dim, "");112for (k = 0; k < dim; ++k)113for (l = 0; l < dim; ++l)114B->gen[nr]->array.SZ[k][l] = G.g[i][j][l][k];115++nr;116}117}118return(B);119}120121/*********************************************************************\122| writes the prime power decomposition123| of G.ord[flags.STAB] *...* G.ord[G.dim-1] to B->divisors124\*********************************************************************/125static void putord(G, flags, B)126group G;127flagstruct flags;128bravais_TYP *B;129{130int i, j, dim, fac;131132dim = G.dim;133for (i = 0; i < 100; ++i)134B->divisors[i] = 0;135B->divisors[1] = 1;136B->order = 1;137for (i = flags.STAB; i < dim; ++i)138{139fac = G.ord[i];140B->order *= fac;141for (j = 2; j <= dim+1 && fac != 1; ++j)142{143if (fac % j == 0)144{145++(B->divisors[j]);146fac = fac / j;147--j;148}149}150}151}152153/*******************************************************\154| prints an isometry onto a matrix155\*******************************************************/156static matrix_TYP *putiso(X, flags, dim)157int **X, dim;158flagstruct flags;159{160int i, j;161matrix_TYP *M;162extern matrix_TYP *init_mat();163164M = init_mat(dim, dim, "");165for (i = 0; i < dim; ++i)166for (j = 0; j < dim; ++j)167M->array.SZ[i][j] = X[i][j];168return(M);169}170171172