GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
#include"typedef.h"1#include"bravais.h"2#include"base.h"3#include"voronoi.h"4#include"matrix.h"5#include"getput.h"6#include"symm.h"7#include"autgrp.h"8#include"reduction.h"9#include"datei.h"10111213/* -----------------------------------------------------------14Berechne Normalisator von H:15H: Gruppe (WIRD GEAENDERT!!!!!!!!!!!!!!)16Gtr: transponierte von H, kann NULL sein17A: G-perfekte Form, kann NULL sein18prime: Primzahl, kann 0 sein19b_option: Normalisator der Bravaisgruppe von H wird berechnet20o_option: Gib Ergebnis auf Bildschirm aus21------------------------------------------------------------- */22void normalisator(bravais_TYP *H,23bravais_TYP *Gtr,24matrix_TYP *A,25int prime,26boolean b_option,27boolean o_option)28{29bravais_TYP *G;30bravais_TYP *GB; /* the bravais group of G */3132matrix_TYP *tmp,33*tmp2;3435voronoi_TYP **V;3637int Vanz,38i;3940boolean gtr_flag = FALSE,41a_flag = FALSE;42434445/* throw away the normalizer of H */46for (i = 0; i < H->normal_no; i++){47free_mat(H->normal[i]);48}49if (H->normal != NULL && H->normal_no > 0)50free(H->normal);51H->normal = NULL;52H->normal_no = 0;5354if (b_option){55G = copy_bravais(H);56}57else{58G = bravais_group(H, FALSE);59}6061/* let's see whether we already got the formspace */62if (G->form == NULL){63G->form = formspace(G->gen, G->gen_no, 1, &G->form_no);64}6566/* transposed group */67if (Gtr == NULL){68Gtr = tr_bravais(G,1,FALSE);69gtr_flag = TRUE;70}7172/* G-perfect form */73if (A == NULL){74/* firstly calculate an positive definite G-invariant form */75tmp2 = init_mat(G->dim, G->dim, "1");76tmp = rform(G->gen, G->gen_no, tmp2, 101);77free_mat(tmp2);7879/* now calculate the trace bifo */80tmp2 = trace_bifo(G->form ,Gtr->form, G->form_no);81A = first_perfect(tmp, G, Gtr->form, tmp2, &Vanz);82free_mat(tmp2);83free_mat(tmp);8485a_flag = TRUE;86}87if (prime == 0)88prime = 1949;8990GB = bravais_group(G,TRUE);91V = normalizer(A, GB, Gtr, prime, &Vanz);92G->normal = GB->normal; G->normal_no = GB->normal_no;93GB->normal = NULL; GB->normal_no = 0;94free_bravais(GB);9596/* now we got G and it's normalizer, so see what we can do with H */97if (b_option){98/* very easy in this case */99H->normal = G->normal;100H->normal_no = G->normal_no;101G->normal = NULL;102G->normal_no = 0;103}104else{105H->normal = normalizer_in_N(H, G, &H->normal_no, FALSE);106}107108if(o_option){109put_bravais(H, NULL, "group with complete normalizer");110put_bravais(Gtr, NULL, "Transposed group");111for(i = 0; i < Vanz; i++)112put_voronoi(V[i]);113}114115/* cleaning up the memory */116for(i=0;i<Vanz;i++){117clear_voronoi(V[i]);118free(V[i]);119}120free(V);121free_bravais(G);122if (a_flag)123free_mat(A);124if (gtr_flag)125free_bravais(Gtr);126}127128129130