GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
#include <typedef.h>1#include <getput.h>2#include <bravais.h>3#include <matrix.h>4#include <base.h>5#include <datei.h>6#include <idem.h>7#include <longtools.h>89int INFO_LEVEL;10extern int SFLAG;1112int main(int argc,char **argv){1314bravais_TYP *G = NULL,15*H;1617matrix_TYP *F,18*FI,19*ID,20*T= NULL;2122lattice_element **RES;2324int almost,25zclass,26number,27i,28j,29no_N_classes;3031char comment[1000],32*symb = NULL;3334read_header(argc,argv);3536if ((is_option('h') && optionnumber('h')==0) ||37((FILEANZ != 1))){38printf("Usage: %s 'file' [-S]\n",argv[0]);39printf("\n");40printf("file: bravais_TYP containing a Bravais group G.\n");41printf("\n");42printf("Lists representatives of the Bravais subgroups (resp. Bravais supergroups \n");43printf("with option -S) of the BRAVAIS GROUP G under the conjugation action of\n");44printf("the normalizer of G in GL_n(Z).\n");45printf("Remark: Without option -G only the symbols of the Bravais groups are given.\n");46printf("\n");47printf("Options:\n");48printf("-S: Search for all supergroups\n");49printf("-G: Calculate generators for the groups as well\n");50printf("\n");51printf("Cf. Bravais_catalog, Symbol.\n");52if (is_option('h')){53exit(0);54}55else{56exit(31);57}58}5960INFO_LEVEL = optionnumber('h');6162if (INFO_LEVEL & 12){63SFLAG = 1;64}6566if (FILEANZ == 1){67G = get_bravais(FILENAMES[0]);6869/* cause the program to recalculate the formspace if desired */70if (is_option('f')){71for (i=0;i<G->form_no;i++){72free_mat(G->form[i]);73}74free(G->form);75G->form=NULL;76G->form_no = 0;77}7879/* we desperately will need the space of forms */80if (G->form_no == 0 || G->form == NULL){81G->form = formspace(G->gen,G->gen_no,1,&G->form_no);82}8384/* if (!is_option('b')){85H = bravais_group(G,FALSE);86free_bravais(G);87G = H;88H = NULL;89} */9091ID = init_mat(G->dim,G->dim,"1");92F = rform(G->gen,G->gen_no,ID,101);93symb = symbol(G,F);94H = catalog_number(G,symb,&T,&almost,&zclass);95free_bravais(H);96free_mat(F);97free_mat(ID);98}99100if (is_option('S')){101RES = super_lattice(symb,G->dim,almost,zclass,&number,is_option('G'));102103if (!is_option('G')){104printf("Bravais groups which contain a Z-equivalent subgroup\n");105for (i=0;i<number;i++){106printf("Symbol: %s homogeneously d.: %d zclass: %d\n",107RES[i]->symbol,RES[i]->almost,RES[i]->zclass);108}109}110else{111/* we now have to care for the transformation matrix */112printf("bravais supergroups of the groups G in %s\n",FILENAMES[0]);113printf("number of Z-conjugacy classes: %d\n",number);114no_N_classes = 0;115for (i=0;i<number;i++){116no_N_classes += RES[i]->N_orbits;117}118printf("number of N_GLn(Z)(G)-conjugacy classes: %d\n",no_N_classes);119for (i=0;i<number;i++){120for (j=0;j<RES[i]->N_orbits;j++){121F = mat_mul(T,RES[i]->TR[j]);122FI = long_mat_inv(F);123H = konj_bravais(RES[i]->grp,FI);124free_mat(F);125free_mat(FI);126sprintf(comment,"%s %d %d, %d-th N-orbit",RES[i]->symbol,127RES[i]->almost,RES[i]->zclass,j+1);128129130if (is_option('A')){131sprintf(comment,"%s.%s.%d.%d.%d",FILENAMES[0],RES[i]->symbol,132RES[i]->almost,RES[i]->zclass,j+1);133put_bravais(H,comment,NULL);134}135else{136put_bravais(H,NULL,comment);137}138free_bravais(H);139}140}141}142143}144else{145RES = lattice(symb,G->dim,almost,zclass,&number,is_option('G'));146147if (!is_option('G')){148printf("Bravais subgroups of the groups G in %s\n",FILENAMES[0]);149for (i=0;i<number;i++){150printf("Symbol: %s homogeneously d.: %d zclass: %d\n",151RES[i]->symbol,RES[i]->almost,RES[i]->zclass);152printf("Number of occurences in the group: %d\n",RES[i]->alpha);153printf("Number of orbits under the normalizer: %d\n",154RES[i]->N_orbits);155}156}157else{158/* we now have to care for the transformation matrix */159printf("bravais subgroups of the groups G in %s\n",FILENAMES[0]);160printf("number of Z-conjugacy classes: %d\n",number);161no_N_classes = 0;162for (i=0;i<number;i++){163no_N_classes += RES[i]->N_orbits;164}165printf("number of N_GLn(Z)(G)-conjugacy classes: %d\n",no_N_classes);166F = mat_inv(T);167free_mat(T);168T = F;169for (i=0;i<number;i++){170for (j=0;j<RES[i]->N_orbits;j++){171F = mat_inv(RES[i]->TR[j]);172ID = mat_mul(T,F);173free_mat(F);174H = konj_bravais(RES[i]->grp,ID);175free_mat(ID);176sprintf(comment,"%s %d %d, %d-th N-orbit",RES[i]->symbol,177RES[i]->almost,RES[i]->zclass,j+1);178put_bravais(H,NULL,comment);179free_bravais(H);180}181}182}183}184185186/* clean up the lattice */187for (i=0;i<number;i++){188free_lattice_element(RES[i]);189}190free(RES);191192/* clean up */193if (G != NULL) free_bravais(G);194if (T != NULL) free_mat(T);195if (symb != NULL) free(symb);196197if (INFO_LEVEL & 12){198fprintf(stderr,"write pointer_statistics\n");199pointer_statistics(0,0);200}201202exit(0);203204} /* main */205206207