Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
| Download
GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
Project: cocalc-sagemath-dev-slelievre
Views: 418346#include <typedef.h>1#include <getput.h>2#include <matrix.h>3#include <base.h>45#include <gmp.h>67int INFO_LEVEL;8extern int SFLAG;91011main(int argc,char **argv){1213bravais_TYP *G;1415matrix_TYP **base,16**K;1718MP_INT Order;1920int i,21j,22l,23siz,24anz,25factors[100],26order;2728char comment[1000];293031read_header(argc,argv);3233if ((is_option('h') && optionnumber('h')==0) || (FILEANZ < 1)){34printf("Usage: %s 'file1' [-M] [-N]\n",argv[0]);35printf("\n");36printf("file1: bravais_TYP.\n");37printf("\n");38printf("Decides whether the given INTEGRAL matrix group is finite.\n");39printf("If it is so, it will echo the order of the group.\n");40printf("\n");41printf("Options:\n");42printf(" -M : Output generators for the Minkowski kernel (i.e the \n");43printf(" subgroup of all matrices congruent I mod 2) of\n");44printf(" the group. WARNING: these generators will be\n");45printf(" correct iff the group was finite. Otherwise\n");46printf(" the program terminates immediatly if it has calculated\n");47printf(" enough element of the kernel to prove the group to\n");48printf(" be infinite.\n");49printf(" -N : Assume the group to be generated by G->gen,G->normal\n");50printf(" and G->cen.\n");51printf(" -o : just output the order in a way that can be appended to\n");52printf(" a bravais_TYP.\n");53printf("\n");54printf("Cf. Order.\n");55if (is_option('h')){56exit(0);57}58else{59exit(31);60}61}6263INFO_LEVEL = optionnumber('h');6465if (INFO_LEVEL & 12){66SFLAG = 1;67}6869G = get_bravais(FILENAMES[0]);7071base = get_base(G);7273mpz_init_set_si(&Order,0);7475if (is_option('N')){76G->gen = (matrix_TYP **) realloc(G->gen,(G->gen_no+G->cen_no+G->normal_no)77*sizeof(matrix_TYP*));78for (i=0;i<G->cen_no;i++)79G->gen[i+G->gen_no] = G->cen[i];8081for (i=0;i<G->normal_no;i++)82G->gen[i+G->gen_no+G->cen_no] = G->normal[i];8384G->gen_no += (G->cen_no + G->normal_no);8586if (G->cen != NULL && G->cen_no > 0) free(G->cen);87if (G->normal != NULL && G->normal_no > 0) free(G->normal);88G->cen_no = 0;89G->normal_no = 0;90G->cen = NULL;91G->normal = NULL;92}9394siz = strong_generators_2(base,G,&K,&anz,&Order);9596if (siz != FALSE){97if (is_option('o')){98order = mpz_get_si(&Order);99factorize_new(order,factors);100fput_order(stdout,factors,order);101}102103fprintf(stderr,"The order of the group is: ");104mpz_out_str(stderr,10,&Order);105fprintf(stderr,"\n");106}107else{108fprintf(stderr,"The group infinite!\n");109}110111if (is_option('M')){112printf("#%d\n",anz);113for (i=0;i<anz;i++){114sprintf(comment,"%dth-generator for the kernel of the Minkowski hom",115i+1);116put_mat(K[i],NULL,comment,2);117}118}119120mpz_clear(&Order);121for (i=0;i<anz;i++) free_mat(K[i]);122free(K);123for (i=0;i<G->dim;i++) free_mat(base[i]);124free_bravais(G);125free(base);126127if (INFO_LEVEL & 12){128pointer_statistics(0,0);129}130exit(0);131132} /* main */133134135