GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
#include "typedef.h"1#include "name.h"2#include "tools.h"3#include "matrix.h"4#include "getput.h"5#include "bravais.h"6#include "contrib.h"7#include "sort.h"8#include "datei.h"910/*************************************************************************11@12@ matrix_TYP *q_class_inf (bravais_TYP *G,13@ database *database,14@ char *qclass_name,15@ char *symbol,16@ bravais_TYP **OUT,17@ matrix_TYP **PRES,18@ int transformation)19@20@ SIDEEFECTS: G->gen[i] might be checked via Check_mat.21@ G->order and G->divisors WILL be set to the correct value.22**************************************************************************/23matrix_TYP *q_class_inf (bravais_TYP *G,24database *database,25char *qclass_name,26char *symbol,27bravais_TYP **OUT,28matrix_TYP **PRES,29int transformation)30{3132bravais_TYP *H;3334matrix_TYP *DATABASE_MAT,35*MATG,36*ERG = NULL;3738char filetmp[1024];3940int i,41orderG = 0,42possible[1024],43no_possible = 0;4445MATG = compute_q_matrix (G);4647for (i=0;i<MATG->cols;i++)48orderG += MATG->array.SZ[0][i];4950G->order = orderG;51factorize_new(G->order,G->divisors);5253for (i=0;i<database->nr;i++){54if (orderG == database->entry[i].order &&55G->dim == database->entry[i].degree &&56MATG->rows == database->entry[i].no_idem + 9 &&57MATG->cols == database->entry[i].no_conclass ){5859sprintf(filetmp,"%s/tables/qcatalog/dim%d/dir.%s/ordnung.%d/%s/char.%s",60TOPDIR,G->dim,database->entry[i].symbol,61orderG,database->entry[i].discriminant,62database->entry[i].abbreviation);6364DATABASE_MAT = get_mat(filetmp);65if (mat_comp(MATG,DATABASE_MAT) == 0){66possible[no_possible] = i;67no_possible++;68}6970free_mat(DATABASE_MAT);71}72}737475/* there are 5 pairs of groups where the characteristic matrix does76not decide the Q-equivalence. In these cases, get the hands dirty */77while (no_possible > 1) {78i = possible[no_possible-1];79sprintf(filetmp,"%s/tables/qcatalog/dim%d/dir.%s/ordnung.%d/%s/%s",80TOPDIR,G->dim,database->entry[i].symbol,81orderG,database->entry[i].discriminant,82database->entry[i].abbreviation);8384H = get_bravais(filetmp);85ERG = suche_kand (G, H);8687if (ERG == 0){88no_possible--;89free_bravais(H);90}91else{92possible[0] = i;93no_possible = 1;94if (OUT){95*OUT = H;96}97else{98free_bravais(H);99}100}101}102103/* just for sanity */104if (no_possible == 0){105fprintf(stderr,"This group does not appear in the catalog of Q-classes.\n");106fprintf(stderr,"Please verify that CARAT has been installed properly.\n");107fprintf(stderr,"If so, please send a bug-report to\n");108fprintf(stderr," [email protected]\n");109fprintf(stderr,"including the forthcoming output.\n");110put_bravais(G,NULL,NULL);111exit(4);112}113114if (OUT || (transformation && !ERG) ){115i = possible[0];116sprintf(filetmp,"%s/tables/qcatalog/dim%d/dir.%s/ordnung.%d/%s/%s",117TOPDIR,G->dim,database->entry[i].symbol,118orderG,database->entry[i].discriminant,119database->entry[i].abbreviation);120121H = get_bravais(filetmp);122123if (OUT){124*OUT = H;125}126127}128129if (PRES){130i = possible[0];131sprintf(filetmp,"%s/tables/qcatalog/dim%d/dir.%s/ordnung.%d/%s/pres.%s",132TOPDIR,G->dim,database->entry[i].symbol,133orderG,database->entry[i].discriminant,134database->entry[i].abbreviation);135136*PRES = get_mat(filetmp);137}138139/* now we have a group which fits to G, lets see what we want to140return as additional information */141if (transformation && !ERG){142143ERG = suche_kand (G, H);144145if (OUT){146*OUT = H;147}148else{149free_bravais(H);150}151152if (!ERG){153fprintf(stderr,"This group does not appear in the catalog of Q-classes.\n");154fprintf(stderr,"Please verify that CARAT has been installed properly.\n");155fprintf(stderr,"If so, please send a bug-report to\n");156fprintf(stderr," [email protected]\n");157fprintf(stderr,"including the forthcoming output.\n");158put_bravais(G,NULL,NULL);159exit(4);160}161}162163i = possible[no_possible-1];164if (qclass_name)165sprintf(qclass_name,"%s",database->entry[i].abbreviation);166167if (symbol)168sprintf(symbol,"%s",database->entry[i].symbol);169170free_mat(MATG);171172return ERG;173174}175176177178