GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
#include"typedef.h"1#include"matrix.h"2#include"longtools.h"3#include"bravais.h"4/**************************************************************************\5@---------------------------------------------------------------------------6@---------------------------------------------------------------------------7@ FILE: konj_bravais.c8@---------------------------------------------------------------------------9@---------------------------------------------------------------------------10@11\**************************************************************************/1213/**************************************************************************\14@---------------------------------------------------------------------------15@ bravais_TYP *konj_bravais(B, T)16@ bravais_TYP *B;17@ matrix_TYP *T;18@19@ calculates the group T B T^(-1)20@ all informations of B are transformed: B->gen, B->form,....21@---------------------------------------------------------------------------22@23\**************************************************************************/242526bravais_TYP *konj_bravais(B, T)27bravais_TYP *B;28matrix_TYP *T;29{30int i,dim;31bravais_TYP *G;32matrix_TYP *Ti, *Titr, *waste;3334G = init_bravais(B->dim);35Ti = long_mat_inv(T);3637/* inserted tilman 11/4/97 */38if (B->order != 0){39G->order = B->order;40memcpy(G->divisors,B->divisors,100*sizeof(int));41}4243if(B->gen_no != 0)44{45G->gen_no = B->gen_no;46if( (G->gen = (matrix_TYP **)malloc(B->gen_no *sizeof(matrix_TYP *))) == NULL)47{48printf("malloc of 'G->gen' in 'konj_bravais' failed\n");49exit(2);50}51for(i=0;i<B->gen_no;i++)52{53waste = mat_mul(T, B->gen[i]);54G->gen[i] = mat_mul(waste, Ti);55free_mat(waste);56}57}5859if(B->form_no != 0)60{61Titr = tr_pose(Ti);62G->form_no = B->form_no;63if( (G->form = (matrix_TYP **)malloc(B->form_no *sizeof(matrix_TYP *))) == NULL)64{65printf("malloc of 'G->form' in 'konj_bravais' failed\n");66exit(2);67}68for(i=0;i<B->form_no;i++)69{70waste = mat_mul(Titr, B->form[i]);71G->form[i] = mat_mul(waste, Ti);72free_mat(waste);73}74free_mat(Titr);75/* don't do this, it causes trouble in normalizer because76normalizer assumes the space of forms is calculated in the above way:77long_rein_formspace(G->form,G->form_no,1); */78}7980if(B->zentr_no != 0)81{82G->zentr_no = B->zentr_no;83if( (G->zentr = (matrix_TYP **)malloc(B->zentr_no *sizeof(matrix_TYP *))) == NULL)84{85printf("malloc of 'G->zentr' in 'konj_bravais' failed\n");86exit(2);87}88for(i=0;i<B->zentr_no;i++)89{90waste = mat_mul(T, B->zentr[i]);91G->zentr[i] = mat_mul(waste, Ti);92free_mat(waste);93}94}9596if(B->normal_no != 0)97{98G->normal_no = B->normal_no;99if( (G->normal = (matrix_TYP **)malloc(B->normal_no *sizeof(matrix_TYP *))) == NULL)100{101printf("malloc of 'G->normal' in 'konj_bravais' failed\n");102exit(2);103}104for(i=0;i<B->normal_no;i++)105{106waste = mat_mul(T, B->normal[i]);107G->normal[i] = mat_mul(waste, Ti);108free_mat(waste);109}110}111112if(B->cen_no != 0)113{114G->cen_no = B->cen_no;115if( (G->cen = (matrix_TYP **)malloc(B->cen_no *sizeof(matrix_TYP *))) == NULL)116{117printf("malloc of 'G->cen' in 'konj_bravais' failed\n");118exit(2);119}120for(i=0;i<B->cen_no;i++)121{122waste = mat_mul(T, B->cen[i]);123G->cen[i] = mat_mul(waste, Ti);124free_mat(waste);125}126}127128free_mat(Ti);129return(G);130}131132133