GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
#include "ZZ.h"1#include "typedef.h"2#include "getput.h"3#include "name.h"4#include "gmp.h"5#include "name.h"6#include "bravais.h"7#include "datei.h"8#include "matrix.h"9#include "voronoi.h"10#include "autgrp.h"11#include "symm.h"12#include "contrib.h"13#include "base.h"14#include "zass.h"15#include "longtools.h"16#include "sort.h"17#include "idem.h"1819static void rule_out_centerings(bravais_TYP *G,20matrix_TYP *L)21{2223int i;2425matrix_TYP *ele_L,26*ele_tmp;2728/* ele_tmp = mat_inv(L); */29ele_L = long_elt_mat(NULL,L,NULL);30/* free_mat(ele_tmp); */3132for (i=0;i<G->zentr_no;i++){33ele_tmp = long_elt_mat(NULL,G->zentr[i],NULL);34if (mat_comp(ele_tmp, ele_L) != 0){35free_mat(G->zentr[i]);36G->zentr[i] = NULL;37}38free_mat(ele_tmp);39}4041free_mat(ele_L);4243return;4445}464748matrix_TYP *z_class_inf(bravais_TYP *G,49bravais_TYP *DATABASEGROUP,50bravais_TYP **RES,51int *name)52{5354int i = 0,55j,56number,57number2;5859bravais_TYP **QCLASS,60**QCLASS2,61*G_tr = NULL,62*G_ALMOST;6364matrix_TYP *T = NULL,65*ADLATTICE;6667/* split the Q-class of DATABASEGROUP into Z-classes, and68then test each resulting one for Z-equivalence.69Attention: the proper way to do this would be first to70calculate only the homogenously decomposable groups,71fits these, and then test invariant (i.e. index in the homogenously72decomposable lattice), and save a lot of work. */73DATABASEGROUP->form = formspace(DATABASEGROUP->gen,74DATABASEGROUP->gen_no,751,76&DATABASEGROUP->form_no);77QCLASS = q2z(DATABASEGROUP,&number,TRUE, NULL, TRUE);7879/* calculate the almost decomposable lattice */80ADLATTICE = almost_decomposable_lattice(G);81G_ALMOST = konj_bravais(G,ADLATTICE);8283/* added tilman 28.02.00 */84if (G_ALMOST->form == NULL){85G_ALMOST->form = formspace(G_ALMOST->gen,86G_ALMOST->gen_no,1,&G_ALMOST->form_no);87}8889long_rein_formspace(G_ALMOST->form,G_ALMOST->form_no,1);9091if (INFO_LEVEL & 4){92put_mat(ADLATTICE,0,0,0);93}9495/* G_ALMOST is a proper group, ie. has the space of invariant96forms assigned */97while(T == NULL && i < number){98T = z_equivalent(G_ALMOST, &G_tr , QCLASS[i]);99100if (T){101free_bravais(G_tr); G_tr = NULL;102free_mat(T); T = NULL;103104rule_out_centerings(QCLASS[i],ADLATTICE);105QCLASS2 = get_groups(QCLASS+i,1,&number2);106j = 0;107while(T == NULL && j < number2){108if (QCLASS2[j]){109T = z_equivalent(G, &G_tr , QCLASS2[j]);110}111j++;112}113if (T == NULL){114fprintf(stderr,"error in z_class_inf.\n");115fprintf(stderr,"group does not appear in catalog.\n");116put_bravais(G,0,0);117exit(4);118}119}120i++;121}122free_bravais(G_tr);123free_bravais(G_ALMOST);124125if (T == NULL){126fprintf(stderr,"error in z_class_inf.\n");127fprintf(stderr,"group does not appear in catalog.\n");128put_bravais(G,0,0);129exit(4);130}131else{132name[0] = i;133name[1] = j;134*RES = QCLASS2[j-1];135}136137for (i=0;i<number;i++){138free_bravais(QCLASS[i]);139}140for (i=0;i<number2;i++){141if (QCLASS2[i] != NULL && *RES != QCLASS2[i]) free_bravais(QCLASS2[i]);142}143free(QCLASS);144free(QCLASS2);145free_mat(ADLATTICE);146147return T;148}149150151152153