GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
/***** Main program for the isometry program ISOM *****/1/**************************************************************************\2@---------------------------------------------------------------------------3@---------------------------------------------------------------------------4@ FILE: pr_isom.c5@---------------------------------------------------------------------------6@---------------------------------------------------------------------------7@8\**************************************************************************/910#include"typedef.h"11#include "types.h"1213static int normal_option;14static int perp_no;15static int ***perp;16static int perpdim;17static int ***perpbase;18static int ***perpprod;19static int *perpvec;20/*21@-------------------------------------------------------------------------22@ matrix_TYP *pr_isom(F1, F2, Fanz, Erz, Erzanz, options)23@ matrix_TYP **F1, **F2, **Erz;24@ int Fanz, Erzanz, *options;25@26@ The function 'isometry' calculates a matrix X such that27@ X * F1[i] *X^{tr} = F2[i] for 1<= i<= Foanz28@ returned via a pointer to 'matrix_TYP'.29@ If no such matrix exists the functions returns NULL30@ 'pr_aut' applies a pair_reduction to F1[0] and then31@ uses then the function isometry to calculate an isometry32@ for the reduced form33@34@ The arguments of isometry are:35@ matrix_TYP **F1: a set of n times n matrices,36@ the first must be positiv definite37@ matrix_TYP **F2: a set of n times n matrices,38@ the first must be positiv definite39@ int Fanz: the number of the matrices given in 'F1'.40@ int *options: see below.41@ matrix_TYP **Erz: if already elements with g^{tr}F1[i]g = F2[i]42@ are known, the can be used for calculating43@ the isometry.44@ The matrices of known elements can be given45@ to the function by the pointer 'Erz'.46@ int Erzanz: The number of matrices given in 'Erz"47@ int *options: see below.48@49@ options is a pointer to integer (of length 6)50@ The possible options are encoded in the following way:51@ options[0]: The depth, up to wich scalar product combinations52@ shall be calculated. The value should be small.53@ options[0] > 0 should be used only, if the automorphismn54@ group is expected to be small (with respect to the number55@ of shortest vectors).56@ options[1]: The n-point stabiliser with respect to different basis57@ will be calculated.58@ options[2]: If options[2] = 1, additional output is written to the59@ file AUTO.tmp60@ options[3]: If options[3] = 1, Bacher polynomials are used.61@ If options[3] = 2, Bacher polynomial are used up to a deepth62@ specified in options[4].63@ If options[3] = 3, Bacher polynomials are used, using64@ combinations of vectors having the scalar65@ product specified in options[5]66@ options[3] = 4 is the combination of options[3] = 2 and67@ options[3] = 3.68@ options[4]: A natural number number or zero (if options[3] = 2 or 4)69@ options[5]: An integral number (if options[3] = 3 or 4)70@71@ It is possible to use NULL for options,72@ in this case option is assumed to be [0,0,0,0,0,0]73@-------------------------------------------------------------------------74*/7576matrix_TYP *pr_isom(F1, F2, Fanz, Erz, Erzanz, options)77matrix_TYP **F1, **F2, **Erz;78int Fanz, Erzanz, *options;79{80matrix_TYP *T, *X, *X1, **F, *SV1, *SV2;81int i,j,k;82int n, anz, max;8384extern matrix_TYP *isometry();85extern matrix_TYP *short_vectors();86extern matrix_TYP *mat_mul();87extern matrix_TYP *scal_pr();88extern matrix_TYP *pair_red();89extern matrix_TYP *init_mat();9091if((F = (matrix_TYP **) malloc(Fanz *sizeof(matrix_TYP *))) == NULL)92{93printf("malloc of 'F' in 'pr_isom' failed\n");94exit(2);95}96n = F1[0]->cols;97T = init_mat(n,n,"");98for(i=0;i<n;i++)99T->array.SZ[i][i] = 1;100F[0] = pair_red(F1[0], T);101max = F[0]->array.SZ[n-1][n-1];102for(i=1;i<Fanz;i++)103F[i] = scal_pr(T, F1[i], 1);104SV1 = short_vectors(F[0], max, 0, 0, 0, &anz);105SV2 = short_vectors(F2[0], max, 0, 0, 0, &anz);106X1 = isometry(F, F2, Fanz, SV1, SV2, Erz, Erzanz, options);107for(i=0;i<Fanz;i++)108free_mat(F[i]);109free(F);110free_mat(SV1); free_mat(SV2);111if(X1 == NULL)112{113free_mat(T);114return(NULL);115}116X = mat_mul(X1, T);117free_mat(X1); free_mat(T);118return(X);119}120121122/*********************************************************123matrix_TYP *perfect_normal_isometry(F1, F2, SV1, SV2, Erz, Erzanz, options, P, Panz, Pbase, Pdim)124matrix_TYP *F1, *F2, *SV1, *SV2, **Erz, **P, **Pbase;125int Erzanz, *options, Panz, Pdim;126********************************************************/127128129