GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
/**************************************************************************\1@---------------------------------------------------------------------------2@---------------------------------------------------------------------------3@ FILE: pr_aut.c4@---------------------------------------------------------------------------5@---------------------------------------------------------------------------6@7\**************************************************************************/89#include "typedef.h"10#include "matrix.h"11#include "reduction.h"12#include "symm.h"13#include "autgrp.h"14#include "types.h"1516static int normal_option;17static int perp_no;18static int ***perp;19static int perpdim;20static int ***perpbase;21static int ***perpprod;22static int *perpvec;232425/*************************************************************************\26| The functions 'pr_aut' calculates generators and the order of the group27| G := {g in GL_n(Z) | g * Fo[i] * g^{tr} = Fo[i], 1<= i<= Foanz}28| returned via a pointer to 'bravais_TYP'.29| This function applues a pair reduction to Fo[0] before calculating30| the group31|32| The arguments of pr_aut are:33| matrix_TYP **Fo: a set of n times n matrices,34| the first must be positiv definite35| int Foanz: the number of the matrices given in 'Fo'.36| matrix_TYP **Erz: if already element of G are known,37| they can be used for calculating generators38| for the whole group.39| The matrices of known elements can be given40| to the function by the pointer 'Erz'.41| int Erzanz: The number of matrices given in 'Erz"42| int *options: see below.43|44| options is a pointer to integer (of length 6)45| The possible options are encoded in the following way:46| options[0]: The depth, up to wich scalar product combinations47| shall be calculated. The value should be small.48| options[0] > 0 should be used only, if the automorphismn49| group is expected to be small (with respect to the number50| of shortest vectors).51| options[1]: The n-point stabiliser with respect to different basis52| will be calculated.53| options[2]: If options[2] = 1, additional output is written to the54| file AUTO.tmp55| options[3]: If options[3] = 1, Bacher polynomials are used.56| If options[3] = 2, Bacher polynomial are used up to a deepth57| specified in options[4].58| If options[3] = 3, Bacher polynomials are used, using59| combinations of vectors having the scalar60| product specified in options[5]61| options[3] = 4 is the combination of options[3] = 2 and62| options[3] = 3.63| options[4]: A natural number number or zero (if options[3] = 2 or 4)64| options[5]: An integral number (if options[3] = 3 or 4)65|66| It is possible to use NULL for options,67| in this case option is assumed to be [0,0,0,0,0,0]68\*************************************************************************/697071bravais_TYP *pr_aut(Fo, Foanz, Erz, Erzanz, options)72matrix_TYP **Fo, **Erz;73int Foanz, Erzanz, *options;74{75matrix_TYP **F, **E, *SV, *T, *Titr, *Ttr, *w;76bravais_TYP *G, *G1;77int n, anz, i;7879if((F = (matrix_TYP **)malloc(Foanz *sizeof(matrix_TYP *))) == NULL)80{81printf("malloc of F in 'pr_aut' failed\n");82exit(2);83}84E = NULL;85if(Erzanz != 0)86if((E = (matrix_TYP **)malloc(Foanz *sizeof(matrix_TYP *))) == NULL)87{88printf("malloc of E in 'pr_aut' failed\n");89exit(2);90}91T = init_mat(Fo[0]->rows, Fo[0]->cols, "");92n = Fo[0]->cols;93for(i=0;i<n;i++)94T->array.SZ[i][i] = 1;95F[0] = pair_red(Fo[0], T);96Ttr = tr_pose(T);97Titr = mat_inv(Ttr);98for(i=1;i<Foanz;i++)99F[i] = scal_pr(T, Fo[i], 1);100SV = short_vectors(F[0], F[0]->array.SZ[n-1][n-1], 0, 0, 0, &anz);101for(i=0;i<Erzanz;i++)102{103w = mat_mul(Titr, Erz[i]);104E[i] = mat_mul(w, Ttr);105free_mat(w);106}107G1 = autgrp(F, Foanz, SV, E, Erzanz, options);108if ((G = (bravais_TYP *)malloc(sizeof(bravais_TYP))) == 0)109{110printf("malloc of 'G' in 'pr_aut' failed\n");111exit(2);112}113G->gen_no = G1->gen_no;114G->form_no = G->normal_no = G->cen_no = G->zentr_no = 0;115for(i=0;i<100;i++)116G->divisors[i] = G1->divisors[i];117G->order = G1->order;118G->dim = G1->gen[0]->cols;119if((G->gen = (matrix_TYP **)malloc(G->gen_no *sizeof(matrix_TYP *))) == NULL)120{121printf("mallocof 'G->gen' in 'pr_aut' failed\n");122exit(2);123}124for(i=0;i<G->gen_no;i++)125{126w = mat_mul(Ttr, G1->gen[i]);127G->gen[i] = mat_mul(w, Titr);128free_mat(w);129}130free_mat(T);131free_mat(Ttr);132free_mat(Titr); free_mat(SV);133for(i=0;i<Erzanz;i++)134free_mat(E[i]);135if(Erzanz != 0)136free(E);137for(i=0;i<Foanz;i++)138free_mat(F[i]);139free(F);140free_bravais(G1);141return(G);142}143144145146/*********************************************147bravais_TYP *perfect_normal_autgrp(Fo, SV, Erz, Erzanz, options, P, Panz, Pbase, Pdim)148matrix_TYP *Fo, **Erz, *SV, **P, **Pbase;149int Erzanz, *options, Panz, Pdim;150*********************************************/151152153